in reply to Re^5: You won't believe what this regular expression does!
in thread You won't believe what this regular expression does!
And how did you solve it in the end?
...
You won't believe how I did this!
DB<39> $_="/foo\n/foo/\n/foo/////" DB<40> say "$_ --> ",s(/*$)(/)r for split /\n/ /foo --> /foo/ /foo/ --> /foo/ /foo///// --> /foo/
;-P
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: You won't believe what this regular expression does!
by salva (Canon) on Feb 26, 2021 at 14:23 UTC |