in reply to Is it possible to use repetition within a Regular Expression Substitution?

Almost... use the 'e' modifier to the regex:

perl -pi -e 's/^\-{40,40}^M*$/"*" x 80/e' logfile

whih means that the substitution part is treated as expresion and its result is substituted.

  • Comment on Re: Is it possible to use repetition within a Regular Expression Substitution?
  • Download Code