Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: regular expression

by McDarren (Abbot)
on Feb 28, 2010 at 05:51 UTC ( #825734=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    my $string = '~/tmp/hfj/abc/bhd/5009.xmlreal.xml';
    $string =~ s/^.*\/\d+//;
    print "$string\n";
  2. or download this
    use File::Basename;
    $string = '~/tmp/hfj/abc/bhd/5009.xmlreal.xml';
    my ($filename, $directories, $suffix) = fileparse($string);
    $filename =~ s/^\d+//;
    print "$filename\n";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://825734]
[GotToBTru]: late to the conversation .. but thanks, Corion, for the reminder about Perl::Tidy
[Corion]: GotToBTru: Heh ;) I'm not really endorsing it, as I found that any gains made through it are easily squandered by the hours spent on configuring it. At least in my case :)
[GotToBTru]: Like most Swiss Army Knives, you can cut yourself trying to find the blade you actually want
[GotToBTru]: i am satisfied with the default settings turning the seemingly random formatting into something reliable

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2017-02-27 14:30 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (387 votes). Check out past polls.