github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/operator/not_regexp_operator.test (about)

     1  SELECT 'Corn' NOT REGEXP 'Corn' AS 'Corn';
     2  SELECT 'Acorn' NOT REGEXP 'Corn' AS 'Acorn';
     3  SELECT 'Corner' NOT REGEXP 'Corn' AS 'Corner';
     4  SELECT 'Cheese' NOT REGEXP 'Corn' AS 'Cheese';
     5  
     6  SELECT 'Corn' NOT REGEXP '^Co' AS 'Corn';
     7  SELECT 'Acorn' NOT REGEXP '^Co' AS 'Acorn';
     8  SELECT 'Cheese' NOT REGEXP '^Co' AS 'Cheese';
     9  
    10  SELECT 'Corn' NOT REGEXP 'rn$' AS 'Corn';
    11  SELECT 'Acorn' NOT REGEXP 'rn$' AS 'Acorn';
    12  SELECT 'Cheese' NOT REGEXP 'rn$' AS 'Cheese'; 
    13  
    14  SELECT 'Corn' NOT REGEXP '.' AS 'Corn';
    15  SELECT 'Cheese' NOT REGEXP '.' AS 'Cheese';
    16  
    17  SELECT 'Corn' NOT REGEXP '^C.rn$' AS 'Corn';
    18  SELECT 'Crn' NOT REGEXP '^C.rn$' AS 'Crn';
    19  
    20  SELECT 'Tweet' NOT REGEXP '^Tw..t$' AS 'Tweet'; 
    21  SELECT 'Tweat' NOT REGEXP '^Tw..t$' AS 'Tweat'; 
    22  SELECT 'Tweet' NOT REGEXP '^Tw.t$' AS 'Tweet';
    23  SELECT 'Twit' NOT REGEXP '^Tw..t$' AS 'Twit';
    24  
    25  SELECT 'Tweet' NOT REGEXP '^Tw.{2}t$' AS 'Tweet';
    26  SELECT 'Tweat' NOT REGEXP '^Tw.{2}t$' AS 'Tweat';
    27  SELECT 'Tweet' NOT REGEXP '^Tw.{1}t$' AS 'Tweet';
    28  SELECT 'Twit' NOT REGEXP '^Tw.{2}t$' AS 'Twit';
    29  
    30  SELECT 'Twet' NOT REGEXP '^Twe*t$' AS 'Twet';
    31  SELECT 'Tweet' NOT REGEXP '^Twe*t$' AS 'Tweet';
    32  SELECT 'Tweeet' NOT REGEXP '^Twe*t$' AS 'Tweeet';
    33  SELECT 'Twt' NOT REGEXP '^Twe*t$' AS 'Twt';
    34  SELECT 'Twit' NOT REGEXP '^Twe*t$' AS 'Twit';
    35  SELECT 'Twiet' NOT REGEXP '^Twe*t$' AS 'Twiet';
    36  SELECT 'Tweit' NOT REGEXP '^Twe*t$' AS 'Tweit';
    37  
    38  SELECT 'Twet' NOT REGEXP '^Twe+t$' AS 'Twet';
    39  SELECT 'Tweet' NOT REGEXP '^Twe+t$' AS 'Tweet';
    40  SELECT 'Tweeet' NOT REGEXP '^Twe+t$' AS 'Tweeet';
    41  SELECT 'Twt' NOT REGEXP '^Twe+t$' AS 'Twt';
    42  SELECT 'Twit' NOT REGEXP '^Twe+t$' AS 'Twit';
    43  SELECT 'Twiet' NOT REGEXP '^Twe+t$' AS 'Twiet';
    44  SELECT 'Tweit' NOT REGEXP '^Twe+t$' AS 'Tweit';
    45  
    46  SELECT 'Tweet' NOT REGEXP 'Tw|et' AS 'Tweet';
    47  SELECT 'For Let' NOT REGEXP 'Tw|et' AS 'For Let';
    48  SELECT 'Banana' NOT REGEXP 'Tw|et' AS 'Banana';
    49  
    50  SELECT 'Cat' NOT REGEXP 'Cat|Dog' AS 'Cat';
    51  SELECT 'Dog' NOT REGEXP 'Cat|Dog' AS 'Dog';
    52  SELECT 'Doggone' NOT REGEXP 'Cat|Dog' AS 'Doggone';
    53  SELECT 'Banana' NOT REGEXP 'Cat|Dog' AS 'Banana';
    54  
    55  SELECT 'Banana' NOT REGEXP '(an)*' AS 'Banana';
    56  SELECT 'Land' NOT REGEXP '(an)*' AS 'Land';
    57  SELECT 'Cheese' NOT REGEXP '(an)*' AS 'Cheese';
    58  
    59  SELECT 'Banana' NOT REGEXP '^B(an)*d$' AS 'Banana';
    60  SELECT 'Band' NOT REGEXP '^B(an)*d$' AS 'Band';
    61  SELECT 'Bald' NOT REGEXP '^B(an)*d$' AS 'Bald';
    62  SELECT 'Bad' NOT REGEXP '^B(an)*d$' AS 'Bad';
    63  
    64  SELECT 'Tweeet' NOT REGEXP 'e{3}' AS 'Tweeet';
    65  SELECT 'Tweet' NOT REGEXP 'e{3}' AS 'Tweet';
    66  
    67  SELECT 'Tweet 123' NOT REGEXP '[0-9]' AS 'Tweet123';
    68  SELECT 'Tweet ABC' NOT REGEXP '[0-9]' AS 'TweetABC';
    69  
    70  
    71  SELECT 'Tweet 123' NOT REGEXP '[A-Z]' AS 'Tweet123';
    72  SELECT 'ABC' NOT REGEXP '[A-Z]' AS 'ABC';
    73  SELECT '123' NOT REGEXP '[A-Z]' AS '123';
    74  
    75  SELECT '123' NOT REGEXP '[1-3]' AS '123';
    76  SELECT '012' NOT REGEXP '[1-3]' AS '012';
    77  SELECT '045' NOT REGEXP '[1-3]' AS '045';
    78  
    79  SELECT '123' NOT REGEXP '[^1-3]' AS '123';
    80  SELECT '012' NOT REGEXP '[^1-3]' AS '012';
    81  SELECT '045' NOT REGEXP '[^1-3]' AS '045';
    82  
    83  create table t1(a int, b varchar(100));
    84  insert into t1 values(1 , "PowerSlave");
    85  insert into t1 values(2 , "Powerage");
    86  insert into t1 values( 3 , "Singing Down the Lane" );
    87  insert into t1 values(4 , "Ziltoid the Omniscient");
    88  insert into t1 values(5 , "Casualties of Cool");
    89  insert into t1 values( 6 , "Epicloud");
    90  insert into t1 values(7 , "Somewhere in Time");
    91  insert into t1 values(8 , "Piece of Mind");
    92  insert into t1 values( 9 , "Killers");
    93  insert into t1 values(10 , "No Prayer for the Dying");
    94  insert into t1 values(11 , "No Sound Without Silence");
    95  insert into t1 values(12 , "Big Swing Face");
    96  insert into t1 values(13 , "Blue Night");
    97  insert into t1 values(14 , "Eternity");
    98  insert into t1 values(15 , "Scandinavia");
    99  insert into t1 values(16 , "Long Lost Suitcase");
   100  insert into t1 values(17 , "Praise and Blame");
   101  insert into t1 values(18 , "Along Came Jones");
   102  insert into t1 values(19 , "All Night Wrong");
   103  insert into t1 values(20 , "The Sixteen Men of Tain");
   104  SELECT a, b
   105  FROM t1
   106  WHERE b NOT REGEXP '^Power';
   107  drop table t1;