Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

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 tmp.pl 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-03 16:58 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 (54 votes), past polls