Abstract type of a regular expression object.
Find a match for a regular expression.
See also find
and contains
.
Match a regular expression regexstd/text/regex/regex: (regex : string, ignorecase : ? bool, multiline : ? bool) -> regex
over a string s
.
Matches at most atmost
times (and matches all by default).
Returns always an odd number of elements where every even
element is a match and the odd ones the string parts between the
matches.
See also find-allstd/text/regex/find-all: (s : string, r : regex, atmost : ? int) -> list<string>
and strings
.
How many groups are captured by this regex?
Create a new regular expression. Takes two optional parameters. Set ignoreCase
to Truestd/core/types/True: bool
to ignore uppercase/lowercase distinction. If multiline
is set to Truestd/core/types/True: bool
, then ^
and $
match also the beginning and end of every line (instead of the entire input).
Return the pattern as a string.
Replace the first occurrence of regexstd/text/regex/regex: (regex : string, ignorecase : ? bool, multiline : ? bool) -> regex
with a replacement string repl
in a string s
.
The replacement string can contain $$
for a $
sign, $n
for a capture group,
$&
for the entire match ==$0
.
Replace all occurrences of regexstd/text/regex/regex: (regex : string, ignorecase : ? bool, multiline : ? bool) -> regex
with the replacement string repl
in a string s
.
The replacement string can contain $$
for a $
sign, $n
for a capture group,
$&
for the entire match ==$0
.
Return the full matched string of a capture group.
Return the full matched string part for a list of matched capture groups.
Does a regular expression pattern occur in a string s
?
(note: called test
in javascript).
Find a match for a regular expression.
See also execstd/text/regex/exec: (regex : regex, s : string) -> list<sslice>
.
Find all matches for a regular expression in a string.
Check if a capture group was matched.
Replace the first occurrence of regexstd/text/regex/regex: (regex : string, ignorecase : ? bool, multiline : ? bool) -> regex
by the result of the replacement fun repl
in a string s
.
Replace the all occurrences of regexstd/text/regex/regex: (regex : string, ignorecase : ? bool, multiline : ? bool) -> regex
by the result of the replacement fun repl
in a string s
.
Split a string s
in at most atmost
parts using a regular expression r
as separator.
Regular expressions.
The regular expressions conform to the regular expressions of JavaScript as described at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions.