The old Henry Spencer regex library supported a number of character names:
https://mariadb.com/kb/en/mariadb/documentation/functions-and-operators/string-functions/regular-expressions-functions/regular-expressions-overview/#character-names
This was a non-standard, non-POSIX extension in the old library.
In POSIX regex the syntax '[[.xxx.]]' is reserved for collating elements.
For some reasons, Henry Spencer reused the same syntax for its character names extension.
PCRE does not support collating elements yet (but I guess it will in the future).
Currently PCRE only recognizes this syntax and just returns an error that you can see.
There is a number of workarounds possible:
For space:
SELECT ' ' REGEXP ' ';
|
SELECT ' ' REGEXP '[ ]';
|
SELECT ' ' REGEXP '[[:space:]]';
|
SELECT ' ' REGEXP '\\{20}';
|
SELECT ' ' REGEXP '\\x{20}';
|
For dot:
SELECT '.' REGEXP '[.]';
|
SELECT '.' REGEXP '\\.';
|
SELECT '.' REGEXP '\\x2E';
|
SELECT '.' REGEXP '\\x{2E}';
|
How difficult would it be to change your application to use these workarounds?
These two are POSIX compliant and are supported by both libraries:
SELECT ' ' REGEXP ' ';
|
SELECT '.' REGEXP '[.]';
|
Thanks for the report.
bar,
I suppose it's a PCRE limitation, but the replication failure is very unfortunate. Is there anything we can do about it? Maybe a non-default mode or a new version which allows the syntax?