Unsupported
Looking at the implementation of RxParser>>atom
and RxParser>>characterSet
, escaping characters in the range set is simply not supported.
According to the documentation, other "special" characters (^,-,]) can be handled only by a specific placement within the set so not to trigger parsing of a different branch.
Workaround
A workaround would be to split the range set into or-ed group, e.g.
[[a-z]
into
(\[|[a-z])
Better Tool
Note that Pharo users are typically directed to use PetitParser instead of regular expressions for text parsing, as PetitParser is easier to manage and debug. A sort of more object-oriented take on regular expressions to say the least.
[\[]
– Jobbery[[]
nor[\[]
work. – Everard