Files
CMake/Tests/RunCMake/string/RegexMultiMatchClear.cmake
Brad King 1edf138506 Tests/RunCMake: Update cmake_minimum_required versions
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.5 where possible.

Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
2023-02-11 06:24:22 -05:00

18 lines
594 B
CMake

function (output_results msg)
message("results from: ${msg}")
message("CMAKE_MATCH_0: -->${CMAKE_MATCH_0}<--")
message("CMAKE_MATCH_1: -->${CMAKE_MATCH_1}<--")
message("CMAKE_MATCH_2: -->${CMAKE_MATCH_2}<--")
message("CMAKE_MATCH_COUNT: -->${CMAKE_MATCH_COUNT}<--")
endfunction ()
set(haystack "Some::Scope")
string(REGEX MATCHALL "^([^:]+)(::)?" matches "${haystack}")
message("matches: ${matches}")
output_results("string(REGEX MATCHALL)")
string(REGEX REPLACE "^([^:]+)(::)?" "[\\1]" replace "${haystack}")
message("replace: ${replace}")
output_results("string(REGEX REPLACE)")