create. Creating an object

^regex::create[pattern]
^regex::create[pattern][options]

Creates a regex-object from
string-pattern. Pattern is a PCRE-Perl-compatible regular expression.
Some examples of PCRE are given in "Attachment 4: Perl Compatible Regular Expressions".

The following search
options may be used:

i-case-insensitive;
x-ignore "white space" characters and allow #comments till the end of the line;
s-regard $ as the end of the whole text (default);
m-regard $ as the end of the line, but not the whole text;
U-inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by ?; [3.3.0]
g
-find not only the first, but all occurrences of the pattern;
n-return number of matches instead of table with search results; [3.2.2]
'-evaluate values for prematch, match, postmatch columns.

Characters
^ and $ are used in Parser's syntax, that is why if you want to include them in your pattern, they must be given as ^^ and ^$ respectively (see also Literals).



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 29.06.2009