|
Hi all,
Ok, I'll admit, I'm struggling with regular expressions. I think I've cracked it, but thought I'd check first.
First of all, the following should validate a string of characters that can contain only letters, numbers, hyphen and underscore...
"^[A-Za-z0-9_-]+$"
The next one is similar but will validate a .PHP page name that should only have the aforementioned characters in it...
^[a-zA-Z0-9_-]+\.php$
They appear to work okay. Anybody able to confirm that I've done the right thing?
David.
|