in reply to
Why doesn't this s/regex// work?
The other way to match "the last" something in a string is to skip as much as possible. To use it in a deleting expression, you have to substitute what you skipped back in:
s/(.*):.*$/$1/;
[download]
Caution:
Contents may have been coded under pressure.
Comment on
Re: Why doesn't this s/regex// work?
Download
Code
In Section
Seekers of Perl Wisdom