Here's how to do it in Perl 6 (I believe):
This is basically your example with a small addition. The double colons pointed out above tell the engine not to backtrack once it reaches that point, so it will work this way where it wouldn't in Perl 5.rx/ \w+ \:\: \w+ :: <!before \s*(> / # # ^^ important
In reply to Re: Negative Lookahead Assertion Problem (Perl 6)
by kelan
in thread Negative Lookahead Assertion Problem
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |