Do any of the Haskell PCRE libraries provide a function to escape regex metacharacters in a string? I.e. a function to take a string like “[$100]” and turn it into “\[\$100\]”.
I’m looking for the equivalent of Python’s re.escape, which I can’t seem to find in regex-pcre.
I’m not aware of such a function in any of
the PCRE libraries, but depending on what
you are trying to accomplish you could use
PCRE quoting: