vcpkg/scripts/cmake/vcpkg_escape_regex_control_characters.cmake
Hannes Steffenhagen 299f581dc3
[vcpkg] Do not use raw paths inside regexes (#12964)
Co-authored-by: Billy Robert O'Neal <bion@microsoft.com>
2020-08-22 02:23:56 -07:00

5 lines
255 B
CMake

function(vcpkg_escape_regex_control_characters out_var string_with_regex_characters)
string(REGEX REPLACE "[][+.*()^\\$?|]" "\\\\\\0" _escaped_content "${string_with_regex_characters}")
set(${out_var} "${_escaped_content}" PARENT_SCOPE)
endfunction()