I am looking for a version of gsub
which doesn't try to interpret its input as regular expressions and uses normal C-like escaped strings.
Update
The question was initiated by a strange behavior:
text.gsub("pattern", "\\\\\\")
and
text.gsub("pattern", "\\\\\\\\")
are treated as the same, and
text.gsub("pattern", "\\\\")
is treated as single backslash.