Next: irregex match, Previous: irregex pred, Up: irregex [Index]
Compile a regular expression from either a POSIX–style regular expression string (with most PCRE extensions) or an SCSH–style SRE. Return an object representing the compiled regular expression.
There is no (rx ...)
syntax to specify the regular expression, we
just use normal Scheme lists. Technically a string by itself could be
considered a valid SRE, so if we want to just match a literal
string we should use something like:
(irregex `(: ,str))
or use the explicit:
(string->irregex str)
The optional options are a list of any of the following symbols, which must be quoted:
i
case-insensitive
match case–insensitively;
m
multi-line
treat string as multiple lines (effects ^
and $
);
s
single-line
treat string as a single line (.
can match newline);
utf8
UTF-8 mode, assumes strings are byte–strings;
fast
try to optimize the regular expression;
small
try to compile a smaller regular expression.
NOTE The
fast
andsmall
options may not actually make the compiled expression any faster or smaller at the moment.