Click to See Complete Forum and Search --> : Regular expression


Pipe
October 12th, 2001, 09:15 AM
Hiya-

I am working on a phone directory. Below are some examples of how people can use wildcards to perform a search.

Matthews All people with the last name "Matthews"

*, Dave All people with the first name "Dave"

Matthews, D* All people with the last name "Matthews" and a first name beginning with "D"

M*, Dave All people with the first name "Dave" and a last name beginning with "M"

Mat*, D* All people with the first name beginning with "D" and a last name beginning with "Mat"


I want to prevent people from entering "*", or "*,*". I need to prevent people from having these variations with white space etc as well. So basically if they aren't using one of the forms in the examples above I want to not search.

I have never used regular expressions, but I think this would be the perfect place for them.

Any help would be great.
Thanks - pipe