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

Re: Help with a regex

by Eily (Curate)
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/)


Comment on Re: Help with a regex
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2015-07-31 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (275 votes), past polls