Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I have a very complex regex that I want to do the back-referencing for the replacement...
$s =~ s/\ ((0?[1-9]|1[0-2])\/(0?[1-9]|[1-2][0-9]|3[0-1])\/(19|20)?[0-9 +][0-9](\s(((0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9](:[0-5][0-9])?)|((0?[0-9 +]|1[0-2]):[0-5][0-9](:[0-5][0-9])?\s(AM|PM))))?)\ /\n$1\n/g;
The result is desirable when I using $1 but not $+...so I would like to ask, what is their different?
Thank you
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Confusion of the effect of $+ and $1
by igelkott (Priest) on Mar 30, 2008 at 18:30 UTC | |
|
Re: Confusion of the effect of $+ and $1
by Anonymous Monk on Mar 30, 2008 at 18:07 UTC | |
by Anonymous Monk on Mar 30, 2008 at 18:13 UTC |