Project

General

Profile

$regex » History » Revision 9

Revision 8 (Per Amundsen, 01/16/2019 10:31 PM) → Revision 9/10 (Per Amundsen, 01/16/2019 10:32 PM)

_Added in 1.9.0_ 

 *$regex([name], text, re)* 

 Returns the number of strings in text that matched the [[Scripting_Regex|regular expression]]. 

 _See also [[$regsubex]], [[$regsub]], [[$regml]], [[$regmlex]], [[$regerrstr]]._ 

 *Parameters* 

 [name] - Name of the search, which can later be referenced using [[$regml]]. (optional) 
 text - The text to search. 
 re - The [[Scripting_Regex|regular expression]] to perform. 

 *Example* 

 <pre> 
 ; Search the text for the pattern '(hello)' and print the result. 
 //echo -ag Number of matches: $regex(Hello World, /(Hello)/) match 1 is: $regml(1) 
 </pre>