qtil
advanced-security/qtil-swift 0.0.3
Search

Predicate regexEscapeMap

A predicate to define an escape map that allows for any string to be escaped in such a way that it can be used in a regex, and matches itself (e.g., special characters match themselves rather than changing the meaning of the regex).

Used by the predicate escapeRegex.

Caution: This does not handle regex UN-escaping. For example, it does not handle unescaping \uXXXX or \xXX sequences. In terms of unescaping, this can only unescape a raw string back to itself after it has been escaped by this same escape map.

Import path

import qtil.strings.Escape
predicate regexEscapeMap(Char real, Char escaped)