Bug? string sub-command REGEX, mode REPLACE: regex ".*" matched an empty string.
Hi,
please try this:
string(REGEX REPLACE "^(.+)$" "xxx_\\1" out "wow")
message("### ${out}")
string(REGEX REPLACE "^(..*)$" "xxx_\\1" out "wow")
message("### ${out}")
string(REGEX REPLACE "^(.*)$" "xxx_\\1" out "wow") # fails with: regex "^(.*)$" matched an empty string. WHY???
message("### ${out}")
string(REGEX REPLACE ".*" "xxx_wow" out "wow") # fails with: regex ".*" matched an empty string. WHY???
message("### ${out}")
I'm expecting xxx_wow
4 times...
For me the last two (the fails) seem like a bug? What's going on here?
Thanks.