Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Help with a regex

by Eily (Parson)
on Dec 04, 2013 at 19:24 UTC ( #1065638=note: print w/replies, xml ) Need Help??

in reply to Help with a regex

You understood ^ and $ correctly, you probably test it wrong. Could you give us the code sample that makes you reach that conclusion ?

perl -E 'say /^lib/ ? "$_ matched" : "$_ did not match" for qw/nfcclib lib/;'

nfcclib did not match lib matched

Alternatively, you could also use \b which means word boundary (so the regex m<\blib>; or its equivalent /\blib/)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065638]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2017-06-24 19:32 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (562 votes). Check out past polls.