On Dec 16, 2007 4:40 PM, Richard K Miller <[EMAIL PROTECTED]> wrote:
>
> > [Alpha w/spaces], [Alpha w/spaces] [Number] [Date] [Alpha w/spaces]
> > [Number w/ comma/dot] [Number w/ comma/dot] [Alpha]
>
> Dave, it should be something like this:
>
> [A-Za-z\s]+, [A-Za-z\s]+, [0-9]+ [dd-dd-dddd] [A-Za-z\s]+ [0-9,\.]
> [0-9,\.] [A-Za-z]
>
> This assumes a date of mm-dd-yyyy.

Assuming that date format, you need to escape those "d" characters.
Also, you shouldn't use those in a character class, that won't work as
desired, as you have it, it would match one character, either being a
"d", or a "-". And one last point, 0-9 in character classes can also
use that shorter symbol I assume you meant to use (\d) as well as \w
(assuming you're fine with including "_" as well) works for alpha. So
with subpattern capture, you should have something more like this:

([\w\s]+), ([\w\s]+), (\d+) (\d{1,2})-(\d{1,2})-(\d{4}) ([\w\s]+)
([\d,\.]+) (\w+)

That should be a little more flexible with matching dates that don't
specify the full 2 digits on month and day as well if that's desired.

Regards,
Bryan Petty

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to