I have a quick question with a regular expression that I thought someone might know from the head. What will be the regular expression for CakePHP validation if I only want to specify the upper / lower alphabetic number, spaces, punctuation and quotation marks? This is what I have, but this:
'rule' => array('custom', '/[a-z0-9\x20\x21\x2E\x3A\x3B\x3F\x2C\x27\x22]{0,600}/i'),
From what I get, a-z0-9 covers alphanumeric, but shouldn't \ xXX cover punctuation with sixth ASCII codes? And then {0,600] means the length of 0-600 characters, and I mean the top and bottom. What am I missing?
For example: valid: this is a "valid text" that contains "and punctuation!
false: this is an obvious attempt to XSS
source
share