knewter has asked for the wisdom of the Perl Monks concerning the following question:
And the URL line is an optional line (not in most records, as seen above), how would one write a regular expression to match this record and have $1, $2, and $3 be Name, Address, and URL respectively, while matching both of the above records?Name<br /> Address<br /> URL<br /><br /> Name2<br /> Address2<br /><br />
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp with optional group containing backreference
by ikegami (Patriarch) on Aug 15, 2005 at 20:25 UTC | |
|
Re: Regexp with optional group containing backreference
by Transient (Hermit) on Aug 15, 2005 at 20:24 UTC | |
|
Re: Regexp with optional group containing backreference
by GrandFather (Saint) on Aug 15, 2005 at 22:12 UTC | |
|
Re: Regexp with optional group containing backreference
by AReed (Pilgrim) on Aug 16, 2005 at 05:55 UTC | |
|
Re: Regexp with optional group containing backreference
by TedPride (Priest) on Aug 16, 2005 at 07:39 UTC |