Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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

by choroba (Chancellor)
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;


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".

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1030819]
[ambrus]: "could evacuate to open schoolyard and then call or go back to school" => wait what? like power cycling the school building by removing all the kids and then reentering them? how would that fix the problems?
[ambrus]: https://www.xkcd. com/723/ is relevant about earthquakes and phones

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-01-18 12:36 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (161 votes). Check out past polls.