Project

General

Profile

Actions

Scripting Regex » History » Revision 12

« Previous | Revision 12/60 (diff) | Next »
Per Amundsen, 04/27/2015 05:55 PM


Regular Expressions

(*UTF8) - Enables utf8 instead of ascii regular expression.

Modifiers

/g /G - Enables global match.
/i /I - Enables case in-sensitive.
/S - Strips any control codes before matching.
/s - Enables single line match.
/m /M /c /C - Enables multi line match.
/x /X - Eliminates unescaped white space from the pattern.
/U - Enables non greedy mode. (Tries to replace greedy patterns with non greedy patterns + > +?, * -> *?)

Differences between .NET and PRCE

AdiIRC translate some patterns from PRCE into .NET patterns.

(?R) -> .*
(?2) -> .*
(?1) -> .*
++ -> +
[:alnum:] -> a-zA-Z0-9
[:alpha:] -> a-zA-Z
[:ascii:] -> \x00-\x7F
[:blank:] -> \s\t
[:cntrl:] -> \x00-\x1F\x7F
[:digit:] -> 0-9
[:graph:] -> \x21-\x7E
[:lower:] -> a-z
[:print:] -> \x20-\x7E
[:punct:] -> !"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~
[:space:] -> \s\t\r\n\v\f
[:upper:] -> A-Z
[:word:] - > A-Za-z0-9_
[:xdigit:] -> A-Fa-f0-9
\cc -> \x003
\co -> \x00F
\cb -> \x002
\x\{([A-Fa-f0-9]{1,4})\} -> \uXXXX
\E \Q escapes all characters in between

\K is not available in .NET, use (<=abc)d instead.

These are not available and have no .NET counterpart:
code (?{…})
recursive (R), (R1), (R&name), (?R)
define (DEFINE).

List of differences between .NET and PRCE https://stackoverflow.com/questions/3417644/translate-perl-regular-expressions-to-net

Updated by Per Amundsen over 9 years ago · 12 revisions

Also available in: PDF HTML TXT