I’m having some issue getting CMake to match a literal dot in a regex expression. The following regex works, but doesn’t match a dot:
file(STRINGS "${INPUT_FILE}" VERSION_BRANCH_FRIENDLY REGEX "^[ \t]*#define[ \t]+VERSION_BRANCH_FRIENDLY[ \t]+\"[a-zA-Z0-9_\\-]+\".*$")
If I add a dot to the match it does not match anymore, I’ve tried the following:
file(STRINGS "${INPUT_FILE}" VERSION_BRANCH_FRIENDLY REGEX "^[ \t]*#define[ \t]+VERSION_BRANCH_FRIENDLY[ \t]+\"[a-zA-Z0-9_\\-.]+\".*$")
This tells me the regex failed to compile. Escaping the dot with either one or two backslashes makes it compile but not match anything. How can I match a dot with CMake?