Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
go ahead... be a heretic
 
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 romping around the Monastery: (7)
As of 2014-04-17 23:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (458 votes), past polls