Bug #62447 | regexp Return error results | ||
---|---|---|---|
Submitted: | 16 Sep 2011 2:27 | Modified: | 16 Sep 2011 6:00 |
Reporter: | qu xiangfei | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | mysql-5.5.15-win32 | OS: | Windows (windows xp) |
Assigned to: | CPU Architecture: | Any | |
Tags: | REGEXP, SELECT |
[16 Sep 2011 2:27]
qu xiangfei
[16 Sep 2011 6:00]
Valeriy Kravchuk
Please, read the manual, http://dev.mysql.com/doc/refman/5.1/en/regexp.html. a* in REGEXP means "Match any sequence of zero or more a characters." Compare: C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot -proot test -P3312 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 9 Server version: 5.5.15 MySQL Community Server (GPL) Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> select 'Fluffy' regexp '[bsb45y4hrhrh5]*'; +------------------------------------+ | 'Fluffy' regexp '[bsb45y4hrhrh5]*' | +------------------------------------+ | 1 | +------------------------------------+ 1 row in set (0.06 sec) mysql> select 'Fluffy' regexp '[bsb45y4hrhrh5][bsb45y4hrhrh5]*'; +---------------------------------------------------+ | 'Fluffy' regexp '[bsb45y4hrhrh5][bsb45y4hrhrh5]*' | +---------------------------------------------------+ | 1 | +---------------------------------------------------+ 1 row in set (0.00 sec) mysql> select 'Fluffy' regexp '[bsb454hrhrh5][bsb454hrhrh5]*'; +-------------------------------------------------+ | 'Fluffy' regexp '[bsb454hrhrh5][bsb454hrhrh5]*' | +-------------------------------------------------+ | 0 | +-------------------------------------------------+ 1 row in set (0.00 sec) mysql> select 'Fluffy' regexp '[bsb454hrhrh5]*'; +-----------------------------------+ | 'Fluffy' regexp '[bsb454hrhrh5]*' | +-----------------------------------+ | 1 | +-----------------------------------+ 1 row in set (0.00 sec) Note that presence of 'y' in [] matters, as 'Fluffy' contains it. I do not see any bug here.
[16 Sep 2011 7:58]
qu xiangfei
no y
Attachment: 2011-09-16_15-53-02.png (image/x-png, text), 12.74 KiB.
[16 Sep 2011 7:59]
qu xiangfei
I am a novice, don't understand!
Attachment: 2011-09-16_15-56-38.png (image/x-png, text), 19.09 KiB.