Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Regex to get everything before first /

by toolic (Bishop)
on Jun 06, 2011 at 18:59 UTC ( #908351=note: print w/replies, xml ) Need Help??


in reply to Regex to get everything before first /

How's this:
use warnings; use strict; my $thing = 'foo/bar/goo'; (my $stuff) = ($thing =~ /^([^\/]+)/); print "$stuff\n"; __END__ foo

Replies are listed 'Best First'.
Re^2: Regex to get everything before first /
by limzz (Novice) on Jun 06, 2011 at 19:05 UTC

    I love you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2021-01-18 01:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?