Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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

by Corion (Pope)
on Apr 26, 2013 at 12:38 UTC ( #1030817=note: print w/ replies, xml ) Need Help??

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

#!perl -wl use strict; my $__item= 'abc_IoExtFscInjS_GetGlobalDatasetActvMethod'; warn $__item; if ( ($__item =~ m/(?!Eth.+cfg)Eth/i) || ($__item =~ m/(?!abc_Eth.+cfg +)abc_Eth/i) ) { print $`; print $&; print $'; print "match"; } else { print "No match"; }; __END__ abc_IoExtFscInjS_GetGlobalDatasetActvMethod at line 6. abc_IoExtFscInjS_GetGlobalDatasetActvM eth od match

This had me stumped first, but when Perl claims it finds a match, it can also tell you, where :)

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (5)
As of 2015-11-28 20:58 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls