Bug #37892 | REGEXP error when escaping period | ||
---|---|---|---|
Submitted: | 5 Jul 2008 8:26 | Modified: | 7 Jul 2008 11:10 |
Reporter: | Matt Wegrzyn | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: General | Severity: | S3 (Non-critical) |
Version: | 5.0.51b-community-nt | OS: | Windows (Windows 2003 Server) |
Assigned to: | CPU Architecture: | Any |
[5 Jul 2008 8:26]
Matt Wegrzyn
[6 Jul 2008 4:48]
Matt Wegrzyn
An easier example: Throws error: SELECT concat('hello') REGEXP '^[^0-9\-\.]*'; Does not throw error: SELECT concat('hello') REGEXP '^[^\.0-9\-]*';
[7 Jul 2008 11:10]
Sergei Golubchik
A double-escaping is the issue here. MySQL decodes escapes in a character literal, so regexp library sees '^[^0-9-.]*' - it complains because 9-. is an invalid range, as ASCII('.') < ASCII('9'). Either disable backslash escapes or double-escape. See the manual for details.