When I use the regex (.*)*[0]
everything works well:
preg_match('/(.*)*[0]/', 'this is a test string'); var_dump(preg_last_error()); // no code's returned
But when I add another character to char class, it will throw out error:
preg_match('/(.*)*[01]/', 'this is a test string'); var_dump(preg_last_error()); // int(2)
Code #2 means PREG_BACKTRACK_LIMIT_ERROR
. What an additional character can do here though?
This question is related to
php
regex
preg-match
Source: Stackoverflow.com