Bug #111785 | REGEXP needs double slash to escape dot for no reason, not documented | ||
---|---|---|---|
Submitted: | 17 Jul 2023 21:16 | Modified: | 18 Jul 2023 14:07 |
Reporter: | teo teo | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[17 Jul 2023 21:16]
teo teo
[17 Jul 2023 21:32]
teo teo
Apparently I cannot edit my own report, which is incredibly stupid. Where I wrote: ``` How to repeat: SELECT '_.' REGEXP '^(\.){2,2}$' shoud return 1, returns 0 instead. ``` it should be the other way around: ``` How to repeat: SELECT '_.' REGEXP '^(\.){2,2}$' shoud return 0, returns 1 instead. ```
[18 Jul 2023 13:09]
MySQL Verification Team
Hi Mr. teo, Please, always try to use our latest release. With 8.0.33, we get : +---------------------------+ | '_.' REGEXP '^(\.){2,2}$' | +---------------------------+ | 1 | +---------------------------+ Not a bug.
[18 Jul 2023 14:07]
teo teo
Please, always try to use our latest release. > With 8.0.33, we get : > +---------------------------+ > | '_.' REGEXP '^(\.){2,2}$' | > +---------------------------+ > | 1 | > +---------------------------+ Exactly, same as I do. I expected 0. > Not a bug. Care to elaborate?
[18 Jul 2023 14:17]
MySQL Verification Team
Hi, C escape sequences can be found in any C textbook. That means that '\' has to be written as '\\' for regular expressions and many other textual functions.