Elijah has asked for the wisdom of the Perl Monks concerning the following question:
Currently I have the following:
$filename =~ s/.*?[^\w\.\-\_]+\d+//g;
this removes all binary formatting data and any text NOT part of the filename. However if the filename begins with integer values then they get cut off for obvious reasons.
A common string would look something like:
[]14APPS []7Some.filename.here.tar
I want to grab only the filename and remove the rest. I run into issues when the string is something like this:
[]14APPS []750_cent_album.tar
In situations like this the 50 gets stripped off also. Is there a better way of doing this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Remove text formatting from raw irc socket data?
by ikegami (Patriarch) on Sep 25, 2005 at 04:58 UTC | |
|
Re: Remove text formatting from raw irc socket data?
by sgifford (Prior) on Sep 25, 2005 at 04:40 UTC | |
by ikegami (Patriarch) on Sep 25, 2005 at 05:14 UTC | |
|
Re: Remove text formatting from raw irc socket data?
by davidrw (Prior) on Sep 25, 2005 at 03:59 UTC |