<?before>
<? befor XXX> 某字符在 xxx 之前
<?after >
<?after XXX> 某字符之后有XXX
对应的取反分别为:
<!before >
<!before XXX> XXX之前没有
<!after>
<!after xxx> 某字符后面不是 xxx
say "foobar" ~~ /foo <!before baz>/; # -> foo
#baz之前不是foo
say "foobaz" ~~ /foo <!before baz>/; # -> Nil (regex failed)
#baz之前不是foo
say "foobar" ~~ /<!after foo> bar/; # -> Nil (regex failed)
#foo之后不是bar
除了before after, 还有就是代码块类的:
<?{code }>
<!{code }>