Pattern Matching
| From: | Floyd Resler | Date: | Thu, 06 Aug 2009 21:57:12 +0000 |
| Subject: | Pattern Matching | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-296408@lists.php.net to get a copy of this message | ||
I need some assistance in pattern matching. I want allow the admin user to enter a pattern to be matched in my order form editor. When someone then places an order I want to do a match based on that pattern. Some of the examples I thought for the patterns are:
######## - must be numeric and 8 digits
AAAAAA - must be alpha and 6 characters
#A? - must be alphanumeric any length
##-A#A - must have two numbers, a dash, a letter, a number, and a letter
I'm sure regular expressions are the answers but I am not well-versed in those at all and I'm not sure how to make the above patterns work in or even they are the best examples to use. Any help would be greatly appreciated.
Thanks!
Floyd