Skip to content

Regex to literally check for "[" fails with RegularExpression::compile(): Unmatched []

Compiling the regular expression "^(#\[=+\[\.rst:)$" within string(REGEX MATCH) fails with:

RegularExpression::compile(): Unmatched [].
RegularExpression::compile(): Error in compile.
CMake Error at cmake/DocThis.cmake:9 (string):
  string sub-command REGEX, mode MATCH failed to compile regex
  "^(#[=+[.rst:)$".

I expect that escaping the brackets should should do the trick. Is this assumption wrong?

Edited by FlTr
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information