I use MariaDB 10.6.8 and found this strange behaviour when using backslash and escaping backslash.
SET @x := 'abc\\def';
SELECT @x;
-- abc\def
SELECT @x REGEXP '\d' ; -- 1 why this gives no error?
SELECT @x REGEXP '\\d' ; -- 0 \d is not supported in MariaDB but what does this means
SELECT @x REGEXP '\\\d' ; -- 0 ?
SELECT @x REGEXP '\\\\d' ; -- 1 this makes sense: \\d, first slash escapes second
SELECT @x REGEXP '\\\\\d' ; -- 1 ?
SELECT @x REGEXP '\\\\\\\d' ; -- 0 ok
SELECT @x REGEXP '\\\\\\\\d' ; -- 0 ok
Any idea what happens?