File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
245
245
| <K_RECURSIVE:"RECURSIVE">
246
246
| <K_REFERENCES:"REFERENCES">
247
247
| <K_REGEXP: "REGEXP">
248
+ | <K_RLIKE: "RLIKE">
248
249
| <K_REPLACE:"REPLACE">
249
250
| <K_RESTRICT: "RESTRICT">
250
251
| <K_RETURNING: "RETURNING">
@@ -1997,6 +1998,7 @@ Expression RegularCondition() #RegularCondition:
1997
1998
| "@@" { result = new Matches(); }
1998
1999
| "~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASESENSITIVE); }
1999
2000
| <K_REGEXP> [ <K_BINARY> { binary=true; } ] { result = new RegExpMySQLOperator(binary?RegExpMatchOperatorType.MATCH_CASESENSITIVE:RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
2001
+ | <K_RLIKE> [ <K_BINARY> { binary=true; } ] { result = new RegExpMySQLOperator(binary?RegExpMatchOperatorType.MATCH_CASESENSITIVE:RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
2000
2002
| "~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.MATCH_CASEINSENSITIVE); }
2001
2003
| "!~" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASESENSITIVE); }
2002
2004
| "!~*" { result = new RegExpMatchOperator(RegExpMatchOperatorType.NOT_MATCH_CASEINSENSITIVE); }
Original file line number Diff line number Diff line change @@ -1992,6 +1992,12 @@ public void testRegexpBinaryMySQL() throws JSQLParserException {
1992
1992
assertSqlCanBeParsedAndDeparsed (stmt );
1993
1993
}
1994
1994
1995
+ public void testRlike () throws JSQLParserException {
1996
+ String stmt = "SELECT * FROM mytable WHERE first_name RLIKE '^Ste(v|ph)en$'" ;
1997
+ Statement st = CCJSqlParserUtil .parse (stmt );
1998
+ assertStatementCanBeDeparsedAs (st , "SELECT * FROM mytable WHERE first_name REGEXP '^Ste(v|ph)en$'" );
1999
+ }
2000
+
1995
2001
public void testBooleanFunction1 () throws JSQLParserException {
1996
2002
String stmt = "SELECT * FROM mytable WHERE test_func(col1)" ;
1997
2003
assertSqlCanBeParsedAndDeparsed (stmt );
You can’t perform that action at this time.
0 commit comments