Edit: @ikegami was the first person to respond and pointed out my typo.
The raku Regex docs say:
To match any word boundary, use <|w> or <?wb>. This is similar to \b in other languages.
This is what I'm seeing in rakudo:
[309] > "apa pz" ~~ / <|wb> p. /
「pa」
[310] > "apa pz" ~~ / <?wb> p. /
「pz」
<?wb> behaves the way I would expect. What is <|wb> doing?
In perl:
"apa pz" =~ / \b p. /xms;
say $&; # pz
<?wb>does what you want.<|wb>and<|w>are both, IIUC, unsupported syntax that should throw an error. And, indeed, they both do using the soon-to-be-released Raku AST compiler frontend:More officially, no regex syntax starting with
<|is spec'ed in Roast (Raku's test suite/specification).(This means, of course, that it's an error for the docs to refer to
<|w>syntax; I submitted a PR with a fix).