[thelist] [php] '*' inside regexp (preg_match)

Matt Warden mwarden at gmail.com
Tue May 29 16:33:12 CDT 2007


On 5/29/07, Paul Bennett <Paul.Bennett at wcc.govt.nz> wrote:
> echo preg_match("/^[a-zA-Z0-9 -.(),]+$/", 'abc**def');

My guess is that the engine is interpreting " -." as a range. Try
moving the - to the end of the character class.

-- 
Matt Warden
Cleveland, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list