I have written some regexp using the boost.org syntax and they fail to work in SC while they are working fine in some Regexp engine one can find on the web (e.g. https://regex101.com/).
Some cases:
matching a “(”
Escaping a “(” with \(
is considered as group start and not as a “(” character.
The character must be escaped a 2nd time : [\(]
. This is abnormal.
"hello (how low)".findRegexp("\(.+\)"); // doesn't find "(how low")
"hello (how low)".findRegexp("[\(].+[\)]"); // working fine
look behind with alternation symbol “|”
In “hello (how low) hello”, looking for the “h” at the begin of the string or preceded by a “(”, should be written like this, but throws an error :
"hello (how low) hello".findRegexp("(?<=^|\()h"); // throws an error
(test it)
It is definitely the “|” condition within a Look behind which is causing trouble to SC. If I remove it, no more errors (but partial results)
"hello (how low) hello".findRegexp("(?<=[\(])h"); // remove the "|" condition, no error, but partial
"hello (how low) hello".findRegexp("(?<=^)h"); // remove the "|" condition, no error, but partial
While a “|” condition in a standard condition is working fine too which is causing trouble to SC. If I remove it, no more errors (but partial results):
"hello (how low) hello".findRegexp("(^|[\(])h"); // replace the look behind by a standard match , no error, but not the expected result
"hello (how low) hello".findRegexp("(?:^|[\(])h"); // replace the look behind by a standard match , no error, but not the expected result
Is SC using the latest version of the Boost library ?
The documentation linked in the SC help file is for an older version (1.69), while there is a newer version (1.78).