Raku 递归正则表达式语法和 Raku 中的所有匹配变量是什么或如何作为尝试
'hellohelloworldworld' ~~ m{ ^(h\w+?o) (?0) world };
say "\n=$&"
Run Code Online (Sandbox Code Playgroud)
似乎不起作用
请帮忙解决这些问题。
Raku 有专门的匿名递归正则表达式语法:<~~>。
使用此语法,您可以将问题中的正则表达式编写为:
\n\'hellohelloworldworld\' ~~ m{ ^(h\\w+?o) <~~>? world };\n\nsay $/; # OUTPUT: \xc2\xab\xef\xbd\xa2hellohelloworld\xef\xbd\xa3\xe2\x90\xa4\n # 0 => \xef\xbd\xa2hellohello\xef\xbd\xa3\xe2\x90\xa4\xc2\xbb\nRun Code Online (Sandbox Code Playgroud)\n