On 2021-Feb-21, Joel Jacobson wrote:
> regex | engine | deduced_ranges
> ------------+--------+-------------------------------
> ^([a-z])$ | pg | [a-z]
> ^([a-z])$ | pl | [a-z]
> ^([a-z])$ | v8 | [a-z]
> ^([\d-a])$ | pg |
> ^([\d-a])$ | pl | [-0-9a]
> ^([\d-a])$ | v8 | [-0-9a]
> ^([\w-;])$ | pg |
> ^([\w-;])$ | pl | [-0-9;A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w-;])$ | v8 | [-0-9;A-Z_a-z]
> ^([\w-_])$ | pg | [0-9A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w-_])$ | pl | [-0-9A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w-_])$ | v8 | [-0-9A-Z_a-z]
> ^([\w])$ | pg | [0-9A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w])$ | pl | [0-9A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w])$ | v8 | [0-9A-Z_a-z]
> ^([\W])$ | pg |
> ^([\W])$ | pl | [\x01-/:-@[-^`{-©«-´¶-¹»-¿×÷]
> ^([\W])$ | v8 | [\x01-/:-@[-^`{-ÿ]
> ^([\w-a])$ | pg | [0-9A-Z_-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w-a])$ | pl | [-0-9A-Z_a-zªµºÀ-ÖØ-öø-ÿ]
> ^([\w-a])$ | v8 | [-0-9A-Z_a-z]
It looks like the interpretation of these other engines is that [\d-a]
is the set of \d, the literal character "-", and the literal character
"a". In other words, the - preceded by \d or \w (or any other character
class, I guess?) loses its special meaning of identifying a character
range.
This one I didn't understand:
> ^([\W])$ | pg |
--
Álvaro Herrera Valdivia, Chile
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... ¿Quién es el machito que tendría carnet?" (Mafalda)