Hello All,
I wanted regular expression for the following patterns like
Nauzer Bharucha, TNN 10 September 2009, 12:01am IST
IANS 3 September 2009, 02:57pm IST
regular expression should return
date in first group
author in second group
and agency in third group
for below pattern it should return
Nauzer Bharucha, TNN 10 September 2009, 12:01am IST
If you're not yet thinking in regex terms, you need to dissect and
describe your pattern, and then translate it into a regular
expression. Here's a description, as I understand it.
zero or one of
(one or more non-comma characters)
a comma
one or more spaces
(three uppercase letters)
one or more spaces
(one or more non-comma characters)
etc.
Also, note that you can't choose which capture will be $1, $2, etc.
They are assigned strictly in the order in which the left parentheses
appear, left to right (unless you use (? to suppress inclusion of a
particular group).