Text processing
Module regex
Regular expressions.
- re(s)
- Obtain a regular expression from a string representation
s
.
Type Regex, r: Regex
- r.match(s)
- Return true if
r
matches s
, else false.
- r.list(s)
- Return the list of non-overlapping matches.
- r.split(s)
- Split the string
s
into parts,
using pattern r
as a separator.
- r.groups(s)
- Return the list of groups if
r
matches s
,
else null
.
- r.replace(s,f)
- Replace every non-overlapping match
x
with f(x)
.