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

Re: Regex matches string, i do not know why?!

by choroba (Abbot)
on Apr 26, 2013 at 12:41 UTC ( #1030819=note: print w/ replies, xml ) Need Help??


in reply to Regex matches string, i do not know why?!

Try adding grouping parentheses to see what is matching:

my $s = 'abc_IoExtFscInjS_GetGlobalDatasetActvMethod'; print "1 $1\n" if $s =~ /((?!Eth.+cfg)Eth)/i; print "2 $1\n" if $s =~ /((?!abc_Eth.+cfg)abc_Eth)/i;

Output:

1 eth

You are using the /i modifier which makes the matching case insensitive. The string indeed contains "eth" which is not preceded by "eth.+cfg".

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Regex matches string, i do not know why?!
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-09-30 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (363 votes), past polls