[thelist] Quick and dirty Reg Ex question

Iain iain at firelightning.com
Wed Oct 26 15:09:31 CDT 2005


Matt Warden wrote:
> If the RegEx is in a double-quoted string, I believe you'll have to
> quote your \ character.
> 
> preg_match("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*(\\.[a-zA-Z0-9]{2,})*$",
> ...);
> 
> --
> Matt Warden
> Miami University
> Oxford, OH, USA
> http://mattwarden.com
> 
> 
> This email proudly and graciously contributes to entropy.

Thanks Matt,

It was single-quoted, but I think I was actually being colossally stupid and inconsistent with my testing. Works perfectly now. :)

Thanks again,

Iain




More information about the thelist mailing list