diff options
Diffstat (limited to 'Tests/RegexEscapeString.cmake')
-rw-r--r-- | Tests/RegexEscapeString.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RegexEscapeString.cmake b/Tests/RegexEscapeString.cmake new file mode 100644 index 0000000..92aed17 --- /dev/null +++ b/Tests/RegexEscapeString.cmake @@ -0,0 +1,4 @@ +macro(REGEX_ESCAPE_STRING _OUT _IN) + # Escape special regex metacharacters with a backslash + string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") +endmacro() |