Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: Regex Question

by Ratazong (Prior)
on Nov 26, 2012 at 08:30 UTC ( #1005589=note: print w/ replies, xml ) Need Help??

in reply to Re: Regex Question
in thread Regex Question

Your index won't work in case there is an a before the third position, e.g. in the string aba. If you (really) want to use index, use the 3-argument-form instead:

$x = "aba"; print "$x\n" if index($x, "a", 2) == 2;
HTH, Rata

Comment on Re^2: Regex Question
Download Code
Re^3: Regex Question
by kcott (Abbot) on Nov 26, 2012 at 08:43 UTC

    ++ Thanks Ratazong. You're absolutely correct. I've updated my node.

    -- Ken

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2015-05-28 04:59 GMT
Find Nodes?
    Voting Booth?

    In my home, the TV remote control is ...

    Results (548 votes), past polls