The typical use-case is when a regex needs to include user input. Characters with special meaning in regex (i.e. "the dirty dozen" in Perl) need to be escaped. Perl provides the "quotemeta" functionality to do this: simply encapsulate interpolating variables in \Q
and \E
. But Tcl provides no such functionality (and according to this page, even with ARE).
Is there a good (rigorous) implementation of quotemeta in Tcl out there?