Hey,
Haven't done regular expressions in awhile and just trying to piece together some validation rules for a few input forms.
I want to catch any input that is NOT alphanumeric, so ALL symbols/illegal characters etc. BUT the problem is I want to allow spaces.
So my question is, what symbol is it to exclude (or include depending on how you look at it) from being matched. As currently I have the following which works as I want except for the spaces being picked up as invalid!
^ obviously this is wrapped in an if statement.
Have tried googling, but I keep getting loads of tutorials on how to do regular expressions with examples for matching email addresses and the like; not how each symbol is handled etc.
Any help greatly appreciated,
Many thanks.
Lewis.
Haven't done regular expressions in awhile and just trying to piece together some validation rules for a few input forms.
I want to catch any input that is NOT alphanumeric, so ALL symbols/illegal characters etc. BUT the problem is I want to allow spaces.
So my question is, what symbol is it to exclude (or include depending on how you look at it) from being matched. As currently I have the following which works as I want except for the spaces being picked up as invalid!
Code:
(ereg("[^A-Za-z0-9]|[0-9]", $this->jobtitle))
^ obviously this is wrapped in an if statement.
Have tried googling, but I keep getting loads of tutorials on how to do regular expressions with examples for matching email addresses and the like; not how each symbol is handled etc.
Any help greatly appreciated,
Many thanks.
Lewis.