hi all,
I am having a problem of reg expression. I would like to validate a string which is without [@#$%^&()] or any character except [-_"]. How I going to achieve that? Thank you.
| SitePoint Sponsor |
hi all,
I am having a problem of reg expression. I would like to validate a string which is without [@#$%^&()] or any character except [-_"]. How I going to achieve that? Thank you.





Any character except -_"?
Easy:
/\A[-_"]*\Z/
Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?
Mnn... I think I have messed up the sentences. Here is what i concern, I would like to have somethings, say "snow05" or snow-05 or snow_05 (Any characters and numeric or either having [-,_,""] ). I do not want to have "&*($%#?" contain in my string. Thanks for provide me some ideas to implement this.
preg_match('~^[-_"a-z0-9]+$~i', $string);
Never ascribe to malice,
that which can be explained by incompetence.
Your code should not look unmaintainable, just be that way.
Bookmarks