Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: How to extract the substring from a delimiter (dot) to end of string?

by ZZamboni (Curate)
on May 08, 2000 at 21:56 UTC ( [id://10639]=note: print w/replies, xml ) Need Help??


in reply to How to extract the substring from a delimiter (dot) to end of string?

In the spirit of TIMTOWTDI, you could also do:

( $extension ) = $string =~ /([^.]*)$/;

The above will give you the whole string if it does not contain any dots. If you want the result to be undef if there are no dots, you could use:

( $extension ) = $string =~ /\.([^.]*)$/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found