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:
icase-insensitivematch case–insensitively;
mmulti-linetreat string as multiple lines (effects ^ and $);
ssingle-linetreat string as a single line (. can match newline);
utf8UTF-8 mode, assumes strings are byte–strings;
fasttry to optimize the regular expression;
smalltry to compile a smaller regular expression.
NOTE The
fastandsmalloptions may not actually make the compiled expression any faster or smaller at the moment.