Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 :)

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 taking refuge in the Monastery: (3)
As of 2016-10-22 21:19 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (298 votes). Check out past polls.