Recurring patterns with $regex

mIRC Scripting Language
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
User avatar
Tuxman
Administrator
Posts: 1831
Joined: 24.10.2003 00:13
Status: That guy
Contact:

Recurring patterns with $regex

Unread post by Tuxman » 09.11.2012 19:42

The $regex command does not understand expressions like \d{3,5} because mIRC treats a comma as a special character (see the syntax of $gettok() for example). A way to work around it is using a temporary variable for the regular expression.

var %regex = /\d{3,5}/
echo $regex(mystring123,%regex)
^\__/
..O.o

This is Einkaufswagen. Copy Einkaufswagen into your signature to help him on his way to world domination.

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable