jc23 has asked for the wisdom of the Perl Monks concerning the following question:
s/(copyright\s+[\d,-\s]*)/$1, 2003/i
Now i'd like to generalize the search pattern to contain the word copyright and any sequence of years seperated by hyphens, commas and periods,
eg "copyright 1999, 2000-2001, 2002. blah blah blah"
and insert the current year right after the last number specified. In the above example, this would be
"copyright 1999, 2000-2001, 2002, 2003. blah blah blah "
How would i modify the above script?
Thanks so much for everyone's input.
JC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: followup on regex
by sauoq (Abbot) on Jul 21, 2003 at 19:34 UTC | |
|
Re: followup on regex
by Wonko the sane (Curate) on Jul 21, 2003 at 19:24 UTC | |
|
Re: followup on regex
by jc23 (Acolyte) on Jul 21, 2003 at 20:21 UTC | |
by graff (Chancellor) on Jul 22, 2003 at 03:06 UTC |