Succeeds if String matches Regex. For example:
?- re_match("^needle"/i, "Needle in a haystack").
true.
Options:
- anchored(Bool)
- If
true
, match only at the first position
- bol(Bool)
- Subject string is the beginning of a line (default
false
)
- bsr(Mode)
- If
anycrlf
, \R only matches CR, LF or CRLF. If unicode
,
\R matches all Unicode line endings.
Subject string is the end of a line (default false
)
- empty(Bool)
- An empty string is a valid match (default
true
)
- empty_atstart(Bool)
- An empty string at the start of the subject is a valid match
(default
true
)
- eol(Bool)
- Subject string is the end of a line (default
false
)
- newline(Mode)
- If
any
, recognize any Unicode newline sequence,
if anycrlf
, recognize CR, LF, and CRLF as newline
sequences, if cr
, recognize CR, if lf
, recognize
LF and finally if crlf
recognize CRLF as newline.
- start(+From)
- Start at the given character index
- Arguments:
-
Regex | - is the output of re_compile/3, a pattern or a term
Pattern/Flags, where Pattern is an atom or string. The defined flags
and there related option for re_compile/3 are below.
- x:
extended(true)
- i:
caseless(true)
- m:
multiline(true)
- s:
dotall(true)
- a:
capture_type(atom)
- r:
capture_type(range)
- t:
capture_type(term)
|