validating ereg patterns
| From: | Jared Nedzel | Date: | Wed, 29 Mar 2006 16:14:16 +0000 |
| Subject: | validating ereg patterns | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-232834@lists.php.net to get a copy of this message | ||
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?
Thanks,
Jared