- lookahead -
foo <?after bar> matches foo in foobar
- negative lookahead -
foo <!after bar> matches foo in foobaz
- lookbehind -
<?before foo> bar matches bar in foobar
- negative lookbehind -
<!before foo> bar matches bar in sushibar
An example with both: <?before foo> bar <?after baz> matches bar in foobarbaz
This is different from Perl 6 as noted in perl_changes and is subject to change. I'll need to get experience using it and then compare. Perl 6 may have gotten it correct but I'm not sure or convinced. Granted, I don't think deviating from Perl 6 shouldn't be taken lightly.
I have a PR for this but it doesn't work correctly and I have to do a major revision. Not sure when I'll get to it.