Here is a reg exp I found in another message:
if (!ereg ("^[a-zA-Z]+(([\'\- ][a-zA-Z ])?[a-zA-Z]*)*$", $first_field))
{
//do some error processing
}
I am trying to use it in my form in order to understand these things & write my own. I know the if & the !ereg part. For the rest, is it:
1. Starting with 1 or more lower or upper letter/s.
2. Followed by optional ' - and upper/lower letters.
3. Followed by zero or more lower/upper letters.
4. Ending with zero or more of #2 & #3 (above).
Is this a correct understanding? If not, can someone please correct me? If it is correct, can someone explain why it is allowing numbers to be inserted? I have other simpler reg exp that don't allow the data to be inserted if they are not matched, so I think it must be this statement.
My other question, I would like to allow a space in the name, do these mean the same:
[\s]?
[:space:]
Thank you.