I have a regex that parses a string that should be a fully qualified module name for Raku (see below). Since only the auth, ver, and api versions seem to be used in the Precomp modules, I only test for those.
I need to separate out the name of the module from the identifiers.
My regex is:
my $rx := /
^
$<name> = ( [ \w | '::' ] + )
[ ':' $<part> = ( [ 'ver' | 'auth' | 'api' ] )
\< ~ \> $<val> = ( .*? ) ]*
$
/;
Question is whether there is a standard way to match to a Raku module, or a sub so that this regex does not become an error in the future.
Looking at the grammar of Raku, it looks like it is just first eating all adverbs in a package definition, and then checks each one of them if it's either
ver,authorapi, todieif it is not one of these.So, I would say: No, currently there is no standard way to match a Raku module name.