Brian wrote:
John W. Krahn wrote:
Brian wrote:
Partial success.
The value <search for> is normally located starting at the 35th char
into the line.
I split the line so it was at the beginning of a new line and
<replace with> worked.
Unfortunately the dates never changed.
I will sleep on this and attack it again in the morning.
Based on the example you provided I assumed that <search for> was at
the beginning of the line. If it isn't then you need to use different
anchors for the pattern, for example:
Sorry about that.
<snip>
s/(?<= )$search(?= )/$replace/;
Works spot on thank you.
s!\d\d/\d\d/\d{4}!$date!
and s!($date.*?)\d\d/\d\d/\d{4}!$1$today!;
No change to either of the dates.
Er, yes it does work, my mistake was in using "/" date separators in my
post but having "." in my file.
Thanks a lot John, much obliged
regards
Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/