[Melbourne-pm] basic regex - char array vs "pipe brackets"

Christopher Short crshort at gmail.com
Wed Mar 4 22:04:34 PST 2009

Hmm I can never get the hang of MPM not setting the reply-to header!!! :-P

---------- Forwarded message ----------
From: Christopher Short <crshort at gmail.com>
Date: 2009/3/5
Subject: Re: [Melbourne-pm] basic regex - char array vs "pipe brackets"
To: wigs at stirfried.org

>> /^(\w|\@|\.|\-)+$/
> The '+' here means one or more repetion of the previous regex, not
> whatever it happens to match.

cheers, thanks Aaron.
I guess my mental parsing was to process the (\w|\@|\.|\-) which == 1
char, and then add the + , whereas the correct parsing is to regard
the (\w|\@|\.|\-) and + as inseperable.

> BTW both tests will be true for ids with multiple @s. eg
> foo at bar@bah-bah.com. Did you want that behaviour?

hehe yeah I know ... also accepts @@@ and --- and ....

It's not terribly crucial where it is, tho - it gets checked properly later. :-)


More information about the Melbourne-pm mailing list