Scripting Regex » History » Version 5
Per Amundsen, 04/27/2015 05:48 PM
1 | 1 | Per Amundsen | {{>toc}} |
---|---|---|---|
2 | |||
3 | h1. Regular Expressions |
||
4 | |||
5 | 2 | Per Amundsen | (*UTF8) - Enables utf8 instead of ascii regular expression. |
6 | 1 | Per Amundsen | |
7 | h1. Modifiers |
||
8 | |||
9 | /g /G - Enables global match. |
||
10 | /i /I - Enables Case in-sensitive. |
||
11 | /S - Strips any control codes before matching. |
||
12 | /s - Enables single line match. |
||
13 | /m /M /c /C - Enables multi line match. |
||
14 | /x /X - Eliminates unescaped white space from the pattern. |
||
15 | /U - Enabled non greedy mode. (Tries to replace greedy patterns with non greedy patterns + > +?, * -> *?) |
||
16 | |||
17 | h1. Differences between .NET and prce |
||
18 | |||
19 | AdiIRC translate some patterns from PRCE into .NET patterns. |
||
20 | |||
21 | 4 | Per Amundsen | <notextile>++ -> +</notextile> |
22 | 5 | Per Amundsen | <notextile>[:alnum:] -> a-zA-Z0-9</notextile> |
23 | <notextile>[:alpha:] -> a-zA-Z</notextile> |
||
24 | <notextile>[:ascii:] -> \x00-\x7F</notextile> |
||
25 | <notextile>[:blank:] -> \s\t</notextile> |
||
26 | <notextile>[:cntrl:] -> \x00-\x1F\x7F</notextile> |
||
27 | <notextile>[:digit:] -> 0-9</notextile> |
||
28 | <notextile>[:graph:] -> \x21-\x7E</notextile> |
||
29 | <notextile>[:lower:] -> a-z</notextile> |
||
30 | <notextile>[:print:] -> \x20-\x7E</notextile> |
||
31 | <notextile>[:punct:] -> !"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~</notextile> |
||
32 | <notextile>[:space:] -> \s\t\r\n\v\f</notextile> |
||
33 | <notextile>[:upper:] -> A-Z</notextile> |
||
34 | <notextile>[:word:] - > A-Za-z0-9_"</notextile> |
||
35 | <notextile>[:xdigit:] -> A-Fa-f0-9</notextile> |
||
36 | <notextile>\cc -> \x003</notextile> |
||
37 | <notextile>\co -> \x00F</notextile> |
||
38 | <notextile>\cb -> \x002</notextile> |
||
39 | <notextile>\x\{([A-Fa-f0-9]{1,4})\} -> \uXXXX</notextile> |
||
40 | 1 | Per Amundsen | |
41 | \K is not available in .NET, use (<=abc)d instead. |
||
42 | |||
43 | These are not available and have no .NET counterpart: |
||
44 | code (?{…}) |
||
45 | recursive (R), (R1), (R&name) (?R) |
||
46 | define (DEFINE). |
||
47 | |||
48 | List of differences between .NET and PRCE https://stackoverflow.com/questions/3417644/translate-perl-regular-expressions-to-net |