1
CREATE table t1 (xxx char(128));
2
INSERT into t1 (xxx) values('this is a test of some long text to see what happens');
3
SELECT * from t1 where xxx regexp('is a test of some long text to');
5
this is a test of some long text to see what happens
6
EXPLAIN EXTENDED SELECT * FROM t1 WHERE xxx REGEXP('is a test of some long text to');
7
id select_type table type possible_keys key key_len ref rows filtered Extra
8
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where
10
Note 1003 select `test`.`t1`.`xxx` AS `xxx` from `test`.`t1` where regex(`test`.`t1`.`xxx`,'is a test of some long text to')
11
SELECT * from t1 where xxx regexp('is a test of some long text to ');
13
this is a test of some long text to see what happens
14
SELECT * from t1 where xxx regexp('is a test of some long text to s');
16
this is a test of some long text to see what happens
17
SELECT * from t1 where xxx regexp('is a test of some long text to se');
19
this is a test of some long text to see what happens
21
CREATE table t1 (xxx char(128));
22
INSERT into t1 (xxx) values('this is some text: to test - out.reg exp (22/45)');
23
SELECT * from t1 where xxx REGEXP '^this is some text: to test - out\\.regexp [[(][0-9]+[/\\][0-9]+[])][ ]*$';
29
SELECT '' REGEXP BINARY NULL;
32
SELECT NULL REGEXP BINARY NULL;
33
NULL REGEXP BINARY NULL
35
SELECT 'A' REGEXP BINARY NULL;
36
'A' REGEXP BINARY NULL
38
SELECT "ABC" REGEXP BINARY NULL;
39
"ABC" REGEXP BINARY NULL
41
CREATE TABLE t1(a INT, b CHAR(4));
42
INSERT INTO t1 VALUES (1, '6.1'), (1, '7.0'), (1, '8.0');
43
SET @stmt1="SELECT a FROM t1 WHERE a=1 AND '7.0' REGEXP b LIMIT 1";