in reply to Re: How to replace greedy alternation?
in thread How to replace greedy alternation?

This code does not work:
/^(?=.*a)(?=.*b)(?=.*c).*d/
For example, when used in the code below nothing s returned.
echo bacd| perl -ne '/^(?=.*a)(?=.*b)(?=.*c).*d/; print "$1 $2 $3\n";'

Replies are listed 'Best First'.
Re^3: How to replace greedy alternation?
by jwkrahn (Abbot) on Jan 28, 2009 at 07:25 UTC

    That is because there are no capturing parentheses in your regular expression and so $1, $2 and $3 are not affected and thus contain nothing.