Can someone point out what I appear to be missing ?  I am trying to
extract   BEG ... KEYWORD .. END from  the DATA string below:

I only want the BEG to END portion where KEYWORD is in between.   As
is..... I get the entire string.  

 

<script>

 

#!/usr/bin/perl

 

while (<DATA>) {

push(@files, /(BEG.+KEYWORD(?:(?!BEG.+KEYWORD).)*END)/g ) ; } print $_ .
"\n" foreach (@files);

 

__DATA__

BEG blah blah blah more blah ENDBEG blah blah blah more blah KEYWORD END

 

</script>

 

 

 

 

Terry

_______________________________________________
Perl-Unix-Users mailing list
Perl-Unix-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to