Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Question on Regex

by Anonymous Monk
on Nov 18, 2012 at 14:29 UTC ( #1004419=note: print w/replies, xml ) Need Help??


in reply to Re^2: Question on Regex
in thread Question on Regex

Hmm

[ddg://perlfaq nth site:perldoc.perl.org]

perlfaq nth site:perldoc.perl.org

-> perlfaq4#Data: Strings
#Data: Strings
#How do I change the Nth occurrence of something?
#How can I split a [character]-delimited string except when inside [character]?

Close, but no cigar

You can use split

my $fifth = ( split m{/}, $string )[4];

Replies are listed 'Best First'.
Re^4: Question on Regex
by Anonymous Monk on Nov 18, 2012 at 14:43 UTC

    Thanks Monk....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004419]
help
Chatterbox?
and the leaves swirl about...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2016-12-09 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (158 votes). Check out past polls.