github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/function/func_regular_like.test (about) 1 #regexp_like 2 SELECT REGEXP_LIKE('Cat', '.*') Result; 3 SELECT REGEXP_LIKE('Cat', 'b+') Result; 4 SELECT REGEXP_LIKE('Cat', '^Ca') Result; 5 SELECT REGEXP_LIKE('Cat', '^Da') Result; 6 SELECT REGEXP_LIKE(NULL, '.*'); 7 SELECT REGEXP_LIKE('Cat', NULL); 8 SELECT REGEXP_LIKE(NULL, NULL); 9 drop table if exists t1; 10 create table t1(a int, b varchar(100)); 11 insert into t1 values(1 , "PowerSlave"); 12 insert into t1 values(2 , "Powerage"); 13 insert into t1 values( 3 , "Singing Down the Lane" ); 14 insert into t1 values(4 , "Ziltoid the Omniscient"); 15 insert into t1 values(5 , "Casualties of Cool"); 16 insert into t1 values( 6 , "Epicloud"); 17 insert into t1 values(7 , "Somewhere in Time"); 18 insert into t1 values(8 , "Piece of Mind"); 19 insert into t1 values( 9 , "Killers"); 20 insert into t1 values(10 , "No Prayer for the Dying"); 21 insert into t1 values(11 , "No Sound Without Silence"); 22 insert into t1 values(12 , "Big Swing Face"); 23 insert into t1 values(13 , "Blue Night"); 24 insert into t1 values(14 , "Eternity"); 25 insert into t1 values(15 , "Scandinavia"); 26 insert into t1 values(16 , "Long Lost Suitcase"); 27 insert into t1 values(17 , "Praise and Blame"); 28 insert into t1 values(18 , "Along Came Jones"); 29 insert into t1 values(19 , "All Night Wrong"); 30 insert into t1 values(20 , "The Sixteen Men of Tain"); 31 SELECT a, b 32 FROM t1 33 WHERE REGEXP_LIKE(b, '^Power'); 34 drop table t1; 35 36 create table t1(a int, b varchar(100)); 37 insert into t1 values(1 , "PowerSlave"); 38 insert into t1 values(2 , "Powerage"); 39 insert into t1 values( 3 , "Singing Down the Lane" ); 40 insert into t1 values(4 , "Ziltoid the Omniscient"); 41 insert into t1 values(5 , "Casualties of Cool"); 42 insert into t1 values( 6 , "Epicloud"); 43 insert into t1 values(7 , "Somewhere in Time"); 44 insert into t1 values(8 , "Piece of Mind"); 45 insert into t1 values( 9 , "Killers"); 46 SELECT a, REGEXP_LIKE(b, '^P') from t1; 47 drop table t1; 48 49 create table t1(a int, b varchar(100)); 50 insert into t1 values(1 , "PowerSlave"); 51 insert into t1 values(2 , "Powerage"); 52 insert into t1 values( 3 , "Singing Down the Lane" ); 53 insert into t1 values(4 , NULL); 54 insert into t1 values(5 , "Casualties of Cool"); 55 insert into t1 values( 6 , "Epicloud"); 56 insert into t1 values(7 , "Somewhere in Time"); 57 insert into t1 values(8 , NULL); 58 insert into t1 values( 9 , "Killers"); 59 SELECT a, REGEXP_LIKE(b, '^P') from t1; 60 drop table t1; 61 62 select regexp_like('Cat', '*'); 63 select regexp_like('CAT','cat','i') r; 64 select regexp_like('\n','.','n') r; 65 select regexp_like('abc\ndef','^def','m') r; 66 select regexp_like('CAT','cat','iiiiiiic') r;