ketema has asked for the wisdom of the Perl Monks concerning the following question:
all one line. So far i have the following regex:Frank Doe - Toronto SASS,Ajax; Aurora; Brampton; Greenwood; Kilbride; +Maple; Markham; Mississauga; Oshawa; Pickering; Richmond Hill; Thornh +ill; Toronto; Whitby; Woodbridge,4/23/2009,TASS,0
the second capture group can vary, meaning the line of text could have:^(.*,)(.*;\s)?(.*,)(.*,)(.*,)(\d)$
or evenFrank Doe - Toronto SASS,Ajax; Aurora; Woodbridge,4/23/2009,TASS,0
There will always be at least One match on the second capture group, but I am interested in getting that group broken up, so that for each pattern of .*; I get a separate group that I can reference later. How would I go about doing this? ThanksFrank Doe - Toronto SASS,Ajax; Greenwood,4/23/2009,TASS,0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple Capture Groups in RegEx
by shmem (Chancellor) on Apr 24, 2009 at 00:04 UTC | |
by ketema (Scribe) on Apr 24, 2009 at 00:24 UTC | |
by shmem (Chancellor) on Apr 24, 2009 at 00:29 UTC | |
by ELISHEVA (Prior) on Apr 24, 2009 at 06:05 UTC | |
|
Re: Multiple Capture Groups in RegEx
by graff (Chancellor) on Apr 24, 2009 at 03:40 UTC |