Awesome idea!
I tried a simple regex in a scratch buffer:
let reggie = /^p[^p]*p/
Regexplainer incorrectly explains it like so:
START
`p`
One of ^, or p (>= 0x)
`p`
The first caret is correctly explained as the "start" anchor, but the second caret is interpreted as part of the character list.
The first caret inside square brackets actually negates the character list.
So maybe the output of regexplainer would be:
START
`p`
Any character not in the list: `p` (>= 0x)
`p`
And for a character list with multiple characters, e.g. /^p[^p^a]*p/:
START
`p`
Any character not in the list: `p`, `^`, `a` (>= 0x)
`p`
Awesome idea! I tried a simple regex in a scratch buffer:
Regexplainer incorrectly explains it like so:
The first caret is correctly explained as the "start" anchor, but the second caret is interpreted as part of the character list. The first caret inside square brackets actually negates the character list.
So maybe the output of regexplainer would be:
And for a character list with multiple characters, e.g.
/^p[^p^a]*p/
:This is how regex101 treats that last example: https://regex101.com/r/mGQXlb/1