Brent Dax wrote:

> grammar Perl6::Regex {
>   rule metachar { <[<{(\[\])}>:*+?\\|]>                    }
> 
>   rule ws       { [<[\h\v]>|\#\N*]*                        }

Or just:

    rule ws       { [\s|\#\N*]*                              }


>   rule atom     { <ws> (<!metachar> | \\ . | <group>) <ws> }
> 
>   rule modifier { <ws> (<[*+?]> \?? \:?) <ws>              }

    rule modifier { <ws> ([<[*+?]>|<reprange>] \?? \:?) <ws> }
 
    rule reprange { \< [ <bound> [, <bound>?]? | , <bound> ] \> }

    rule bound    { \d+ | <Perl::scalar> }


There are also bits missing from the rest of the grammar (e.g. named captures).
I'll be showing a full regex grammar in E5.

Damian

Reply via email to