Support efficient escaping of special characters according to regular expressions
The programming language “CMake” supports also data processing for regular expressions.
A few characters have got a special meaning there.
If I would like to insert data from a build variable into a regular expression so that the original variable content would be preserved, the content needs to be escaped (if I do not safely know that special characters were not passed).
Such a transformation can be achieved by calling the command “
string(REPLACE …)” a few times.
I imagine that such functionality could be provided in a more efficient way by a companion command like “
string(REGEX ESCAPE …)”.
How do you think about such a software extension?