Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Reaped: Re: Regex To Remove File Extension

by NodeReaper (Curate)
on Dec 05, 2010 at 07:48 UTC ( #875466=note: print w/ replies, xml ) Need Help??


in reply to Regex To Remove File Extension

This node was taken out by the NodeReaper on Dec 05, 2010 at 15:13 UTC
Reason: [BrowserUk]: spam: reap

You may view the original node and the consideration vote tally.


Comment on Reaped: Re: Regex To Remove File Extension
Re: Reaped: Re: Regex To Remove File Extension
by Anonymous Monk on Jun 09, 2014 at 21:49 UTC

    What about doing this:

    $filename =~ /(.*)\./; my $basename = $1;

    Since the regex above is greedy, it should capture everything up to the last period. It seems to work for me. Am I missing something?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://875466]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2014-07-24 21:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (167 votes), past polls