Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- help with perl search/replace regex
January 22, 2010, 6:26 pm
rate this thread
So i have a file with a line
foo_bar_baz (some amount of whitespace) 100 (a number)
I basically want to have a search regex that searches foo_bar_baz(and
then to the end of the line regardless of what text)
and replace it with foo_bar_baz \t (tab) 101 (some dif number
my command is as such but isnt working
perl -i -pe 's/minutes_between_backups$/minutes_between_backups
I thought $ matched to the end of the line?
Re: help with perl search/replace regex
The very first place to look for Perl help are the docs that
come with perl.
You needed to know about a regex metacharacter, and the "Metacharacters"
$ Match the end of the line (or before newline at the end)
email: perl -le "print scalar reverse qq/moc.liamg0cm.j.dat/"