in reply to Re: Extracting substrings
in thread Extracting substrings
Meh, that's too little unneeded complication. Why not use the new (in perl 5.10.0) feature Keep too: print "<<$_>>\n" for "WhateverFooBlahBarMoreFooStuffBarMore" =~ /Foo\K.*?(?=Bar)/gx;
Really, if you add a capture around the word anyway, why do you need the lookaheads at all? print "<<$_>>\n" for "WhateverFooBlahBarMoreFooStuffBarMore" =~ /Foo(.*?)Bar/gx;
|
|---|