Regular expression
Anvil supports regular expressions compatible with Perl 5. A regular expression starts and ends with a slash (/) but must remain on the same line, as line feeds cannot be contained. A backlash may be used to escape some critical characters inside an expression,
such as a slash (/), a backlash (\), and an open bracket ([); other than that, there is no similar quotation mechanism as in strings.
Immediately after the expression, there may a set of flags:
| Flags | Meaning |
| i or I |
Performs case insensitive matching. |
| m or M |
Treats string as multiple lines. That is, change "^"
and "$" from matching the start or end of the string
to matching the start or end of any line anywhere
within the string.
|
| x or X |
Extends the pattern's legibility by permitting whitespace.
|
Examples:
p = /[a-z]+/i;
q = /\/[0-9]+\//;
Add a note
Anvil
|
|