[UPHPU] Regex problem

Dave Smith dave at thesmithfam.org
Sun Dec 16 20:38:12 MST 2007


Richard K Miller 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]

A great start. Just remember that in PHP you have to double-escape the 
back-slahes, \\

--Dave


More information about the UPHPU mailing list