The \p{L} syntax is done by using :L inside of <> instead

    /\p{L}/
    /<:L>/

You can combine them

    /[\p{L}\p{Z}\p{N}]/
    /<:L + :Z + :N>/

Character classes are also done inside of <>

    /[_.:/=+\-@]/
    /<[_.:/=+\-@]>/

They of course can also be combined with the previous discussed feature.

    /[\p{L}\p{Z}\p{N}_.:/=+\-@]+/
    /<:L + :Z + :N + [_.:/=+\-@] >+/

So that is the translation of your regex.

---

It might be considered a bug that you can't just use :P5, as your regex
works just fine in Perl5.

On Tue, Feb 18, 2020 at 10:03 PM Paul Procacci <pproca...@gmail.com> wrote:

> Hey Guys,
>
> I've got a bunch of source files with PCRE's like the following:
>
> [\p{L}\p{Z}\p{N}_.:/=+\-@]+
>
> I have a program that generates other perl6 source files, by way of
> reading the initial source files.
> It was my intention to simply pass along this regex to the resulting
> output file for use in subset's like the following:
>
> subset ThisType of Str where * ~~ m:P5/[\p{L}\p{Z}\p{N}_.:/=+\-@]+/;
>
> I was going to at first hope add a PCRE adverb of sorts but that doesn't
> exist.
> I then was going to stick the Perl5 adverb on it ... but again no luck as
> it pukes on the escaped p's.
>
> Is there anything smart enough to translate these tokens into either:
>
> a) perl5 syntax for use with the Perl5 adverb or
> b) perl6 syntax for use with built-in perl6 re's.
> c) A module that anyone's familiar with that isn't publish or
> d) I'm simply SOL?
>
> Thanks,
> Paul
>
> --
> __________________
>
> :(){ :|:& };:
>

Reply via email to