From WikiChip
Difference between revisions of "mirc/regex"
< mirc

(Created page with "Regular expressions can be used to perform complicated pattern matching operations. You should already know how to use Regular expressions as this page won't teach them. == I...")
 
Line 1: Line 1:
 +
{{mIRC Guide}}
 
Regular expressions can be used to perform complicated pattern matching operations. You should already know how to use Regular expressions as this page won't teach them.
 
Regular expressions can be used to perform complicated pattern matching operations. You should already know how to use Regular expressions as this page won't teach them.
  

Revision as of 20:33, 21 September 2014

Template:mIRC Guide Regular expressions can be used to perform complicated pattern matching operations. You should already know how to use Regular expressions as this page won't teach them.

Informations

mIRC uses the PCRE library to implement regex with the following options enabled:

  • --enable-utf8
  • --enable-unicode-properties
  • --with-match-limit - around 1,000,000
  • --with-match-limit-recursion - 999

mIRC has two custom modifier:

  • S - strips control code from the input before matching.
  • g - perform a global matches: after one match has been found, mIRC tries to match again from the current position

mIRC remembers up to 50 regex matches. After 50 matches, the first match is overwritten.

The $identifiers can take an optional name as a parameter, to reference that call later, if you do not specify a name, mIRC use a default.

$regex([name],<input>,<regex>)

Returns the number of matches found. Returns a negative value to indicate an error (-8 if you reach the maximum number of match allowed or -21 if you read the maximum number of recursion allowed)

mIRC remembers up to 32 captured text (backreference), you can use $regml([name],N) to returns the Nth backreference, or the total number of backreferences with N = 0

//noop $regex(name,test,/[es]/g) | echo -a $regml(name,0) : $regml(name,1) -- $regml(name,2)