unsupported
If you look at the implementation of RxParser>>atom and RxParser>>characterSet , escaping characters in a range set is simply not supported.
According to the documentation, other βspecialβ characters (^, -,]) can be processed only by a specific placement inside the set, so as not to start parsing another branch.
Bypass
A workaround would be to split the range given into a group or, for example,
[[az]
in
(\[|[az])
Best tool
Note that Pharo users are usually redirected to use PetitParser instead of regular expressions to parse text, since PetitParser is easier to manage and debug. A more than object-oriented approach takes at least regular expressions.
source share