Webskater
12-15-2005, 09:00 AM
I am ashamed to admit I have absolutely no idea how this bit of code:
if (!/^\w+$/.test(userInput) || (/\_/g.test(userInput)))
tests for making sure a text string only contains a-z or 0-9 ...
but it seems to work.
Can anyone tell me what needs to be done to allow it to include an underscore, stop and a hyphen please.
Thanks very much.
if (!/^\w+$/.test(userInput) || (/\_/g.test(userInput)))
tests for making sure a text string only contains a-z or 0-9 ...
but it seems to work.
Can anyone tell me what needs to be done to allow it to include an underscore, stop and a hyphen please.
Thanks very much.