can someone help explain to me in simple English what this statement does: if(!preg_match("/^[a-zA-Z0-9+\/ _-]+$/D", $v)) i would like to allow for the inclusion of the character '$' in the string as it's not now allowed and i do not understand what this statement is allowing or not allowing.. a step by step breakdown would be real helpful.. maybe starting out with: if not preg_match allow characters a-z, 0-9, etc.. something like that..
This page gives you a more or less complete answer: http://www.addedbytes.com/download/regular-expressions-cheat-sheet-v1/png/ Additionally, you can find some answers here: http://stackoverflow.com/questions/10201337/what-do-the-symbols-mean-in-preg-match
$ is restricted, to include it you have to escape it with a backslash just like the forward slash was. The \/ in there is the backslash escaping the forward slash so you can use it... just like you would with \\, \^, \[, \], etc, etc... Any time you want a literal version of one of the regex control characters, you escape it with a forward slash. I think that your "plus" should also be escaped in that since it too is a control character. if (!preg_match("/^[a-zA-Z0-9\+\/ _-\$]+$/D", $v)) Should do what you are asking.
ok, i think it get then that the characters within the [] brackets are what's allowed??? then after the ] what does the +$/D do??