REGEX MATCH fails to compile (semver, subgroups)
tee regexFailure.cmake <<EOL
string(REGEX MATCH "^([0-9][0-9]*)\\.([0-9][0-9]*)\\.([0-9][0-9]*)(-(([0-9][0-9]|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\\.([0-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*))?$" SEMVER "99.0.14-test.99")
include(CMakePrintHelpers)
cmake_print_variables(SEMVER)
EOL
cmake -P regexFailure.cmake
The above fails in the CMake 3.24.1 with the error below.
...
CMake Error at create_git.cmake:23 (string):
string sub-command REGEX, mode MATCH failed to compile regex
...
I'm trying to parse entire semver version but it doesn't work well