Regex to match odd numbers

Mark Fowler mark at twoshortplanks.com
Tue May 27 20:37:51 BST 2014


On Tuesday, May 27, 2014, Sam Kington <sam at illuminated.co.uk> wrote:
>
> Sounds like you want something like
>
> / ( ^ 5[.] ( [79] | \d+ [13579] ) ) /x
>

This is where I mention that \d matches characters other than [0-9] unless
you have the /a flag in effect (thanks Unicode!)

Mark


More information about the london.pm mailing list