Here we summarize the syntax of Perl5 regular expressions, all of which are supported by the WebL. However, for a definitive reference, you should consult the perlre man page that accompanies the Perl5 distribution and also the book Programming Perl, 2nd Edition from O'Reilly & Associates. We need to point out here that for efficiency reasons the character set operator [...] is limited to work on only ASCII characters (Unicode characters 0 through 255). Other than this restriction, all Unicode characters should be useable in the package's regular expressions.
Perl5 regular expressions consist of:
Quantified atoms ( See Quantified Atoms )
Regular expression within parentheses, character classes (e.g., [abcd]), ranges (e.g. [a-z]), and the patterns in See Atoms . Special backslashed characters work within a character class (except for backreferences and boundaries). \b is backspace inside a character class. Any other backslashed character matches itself. Expressions within parentheses are matched as subpattern groups and saved for use by certain methods.
By default, a quantified subpattern is greedy. In other words, it matches as many times as possible without causing the rest of the pattern not to match. To change the quantifiers to match the minimum number of times possible, without causing the rest of the pattern not to match, you may use a "?" right after the quantifier ( See Quantified Atoms with Minimal Matching ). Perl5 extended regular expressions are fully supported (See See Perl5 Extended Regular Expressions ).
Combining regular expresions and WebL code might sometimes be a little confusing. The following tips might help:
When possible, write WebL regular expressions in single-back quotes e.g. `ab\nc`. This will switch off escape character expansion, and prevent WebL from complaining about illegal escape sequences like "\d".
When matching URLs, keep in mind that "." and "?" do not have a literal meaning in regular expressions. Use the "[]" character classes to match these symbols, e.g. write "www[.]xyz[.]com" instead of "www.xyz.com".