Re: Raku regex assert doesn't match

2023-07-31 Thread Ralph Mellor
On Sun, Jul 30, 2023 at 5:21 AM Darren Duncan wrote: > > match this pattern initially, but > > fully declarative Do you consider `> .*` to be declarative? If so, what about: ``` my token nonquoted_alphanumeric_text { <[ A..Z _ a..z ]> <[ 0..9 A..Z _ a..z ]>* & >

Re: Raku regex assert doesn't match

2023-07-31 Thread William Michels via perl6-users
Hi Darren, Glad that's useful. FYI, I was trying to get you an answer using the `&&` Conjunction method as well, but fell short because you want to filter out certain literal words (i.e. negation). That's why I simplified your regex pattern to ` + `. I trust you know your specifications.

Re: Raku regex assert doesn't match

2023-07-30 Thread Darren Duncan
Thank you William, that boolean condition check option looks like it is in the direction of the answer I sought. FYI, the reason I spelled out the character class explicitly rather than using "" was because I wanted it strictly applied to ASCII chars and not everything Unicode considers a

Re: Raku regex assert doesn't match

2023-07-30 Thread William Michels via perl6-users
Hi Darren (and Marcel), Two different approaches: https://docs.raku.org/language/regexes#Conjunction:_&; >From the docs: *"For example if you have a regex quoted that matches a quoted string, then `/ && <-[x]>* /` matches a quoted string that does not contain the character `x`."* Second

Re: Raku regex assert doesn't match

2023-07-30 Thread Marcel Timmerman
On 30-07-2023 06:21, Darren Duncan wrote: Hello, I have a Raku regex question. See the following:     token nonquoted_alphanumeric_text     {     >     <[ A..Z _ a..z ]> <[ 0..9 A..Z _ a..z ]>*     } What I want is for "nonquoted_alphanumeric_text" to match any simple ASCII bareword

Raku regex assert doesn't match

2023-07-29 Thread Darren Duncan
Hello, I have a Raku regex question. See the following: token nonquoted_alphanumeric_text { > <[ A..Z _ a..z ]> <[ 0..9 A..Z _ a..z ]>* } What I want is for "nonquoted_alphanumeric_text" to match any simple ASCII bareword EXCEPT a few special cases indicated in the