Question: RegularExpression wrapper to escape \ ?

using regular expression in Maple is little annoying, because one has to escape \ in the regx string itself, which makes it more complicated compared to other languages. For example

StringTools:-RegMatch("^\[.*\]$","[A]")

gives false. But

StringTools:-RegMatch("^\\[.*\\]$","[A]")

gives true.

Other languages have special function to generate the regx itself, which does not require escaping the \ when writing the regx Which makes it easier to see the regx (escaping is done under the cover). like this

Since all places and web sites that show examples of regx., do not have to escape \ before using, it will be good if Maple adds such special new function to StringTools to generate regx like the above so users do not have to remember to escape \.   

It is hard enough to use regx without having to also remember to escape things.

I could not find such a function in Maple. Does one exist?

Maple 2025.2

Please Wait...