Link to home
Create AccountLog in
Avatar of Ike McMahon
Ike McMahonFlag for United States of America

asked on

Regular Expression Qestion - Reg Ex Question

Howdy!

Thanks for taking a look at this.  Can anyone tell me why this regular expression is removing spaces?  I think I've been staring at it for too long or something.

$myvar = preg_replace("/[^a-z\d.,-]/i", "", $myvar);

Thanks in advance!

ike1492
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
in code:

$myvar = preg_replace("/[^a-z\d\s.,-]/i", "", $myvar);
Avatar of Ike McMahon

ASKER

Glad it wasn't a snake! thanks very much!