[UPHPU] Regex problem
Richard K Miller
richardkmiller at gmail.com
Sun Dec 16 16:40:29 MST 2007
On Dec 16, 2007, at 3:57 PM, D. Turnbull wrote:
> I have a string that I need to split into an array. The string always
> follows this format:
>
> [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. This doesn't "capture" anything,
which you'll probably want to do by putting parentheses around groups.
I can help you with specifics if you want to talk off-list.
Richard
More information about the UPHPU
mailing list