How do I detect the difference between a bad ereg pattern and no matches?
I've got a UI that allows the user to enter an ereg expression. Clearly,
the user may enter an invalid expression (for example, the expression may not
have matching [] brackets). ereg returns false if there are no matches or if
an error occurred.
I need to distinguish between no matches and an error, so I can present a
meaningful message to the user. Any suggestions on how to do this?
Maybe try preg_match. The docs say it will return false for an error,
otherwise the number of times it matched.
-philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php