in reply to repeating patterns 2
If I understand your question correctly, then you'd only want 'stuff1' and 'stuff3' as in the following:
$_ = 'foofoostuff1tarbarfoostuff2barfoostuff3tarbar'; my @a = /foo((?:(?!bar|foo).)*?)tarbar/gs; print "@a\n";
But realize, this rules out getting any 'stuff' that might hold 'bar' or 'foo' in it and the string 'foostuffbartarbar' would *not* give you a match, nor would 'foofoobartarbar', even though there is "stuff" between a 'foo' and a 'tarbar'.
|
|---|