Project

General

Profile

Scripting Regex » History » Revision 5

Revision 4 (Per Amundsen, 04/27/2015 05:47 PM) → Revision 5/60 (Per Amundsen, 04/27/2015 05:48 PM)

{{>toc}} 

 h1. Regular Expressions 

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

 h1. 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 - Enabled non greedy mode. (Tries to replace greedy patterns with non greedy patterns + > +?, * -> *?) 

 h1. Differences between .NET and prce 

 AdiIRC translate some patterns from PRCE into .NET patterns. 

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

 \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