You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am about to implement the Exasol syntax. For this I'd like to implement REGEXP_LIKE as LikeExpression (see https://docs.exasol.com/db/latest/sql_references/predicates/not_regexp_like.htm). Since it is also allowed to be a function in Oracle (as already implemented), it needs to be added to the whitelisted keywords.
Unfortunately, the following condition prevents it from being added to RelObjectNameWithoutValue since REGEXP_LIKE contains an underscore which is not allwed here: tokenValue.matches("[A-Za-z]+")
Thank you for your interest and contribution.
In genera this syntax is supported already and the following works:
SELECT'My mail address is my_mail@exasol.com'
RLIKE '(?i).*[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}.*'AS contains_email;
Now we only need to register REGEXP_LIKE as an Like Operator (like we did for RLIKE yet).
So my advise is: follow the RLIKE implementation and also take reference to the EXTRACT production (which also can be a normal function as well as a special function). Something like this will work for the REGEXP_LIKE operator too.
I will be able to help you on this by next week only since I am somewhere between Jakarta and Lagos right now. Cheers.
This was also my first intension to implement it similar to RLIKE, so I've added a new token <K_REGEXP_LIKE: "REGEXP_LIKE"> and added it as an option to LikeExpression as well as to the Java implementation.
But the problem is, that the updateKeywords task won't whitelist the REGEXP_LIKE token (unlike EXTRACT), because it contains an Underscore. The condition tokenValue.matches("[A-Za-z]+") in the following line prevents it from being whitelisted for function names:
Activity
manticore-projects commentedon Jul 18, 2024
Greetings!
Thank you for your interest and contribution.
In genera this syntax is supported already and the following works:
Now we only need to register REGEXP_LIKE as an Like Operator (like we did for
RLIKEyet).So my advise is: follow the
RLIKEimplementation and also take reference to theEXTRACTproduction (which also can be a normal function as well as a special function). Something like this will work for theREGEXP_LIKEoperator too.I will be able to help you on this by next week only since I am somewhere between Jakarta and Lagos right now. Cheers.
ssteinhauser commentedon Jul 19, 2024
This was also my first intension to implement it similar to RLIKE, so I've added a new token
<K_REGEXP_LIKE: "REGEXP_LIKE">and added it as an option toLikeExpressionas well as to the Java implementation.But the problem is, that the
updateKeywordstask won't whitelist theREGEXP_LIKEtoken (unlikeEXTRACT), because it contains an Underscore. The conditiontokenValue.matches("[A-Za-z]+")in the following line prevents it from being whitelisted for function names:JSqlParser/src/main/java/net/sf/jsqlparser/parser/ParserKeywordsUtils.java
Line 235 in 11cebcf
If there is no specific reason for the restriction to alphabetical characters only, I would suggest to match this regex:
\w+feat: Allow all word characters as token value
ssteinhauser commentedon Jul 19, 2024
I've included an implementation of my suggestion in the PR #2044
Avoid private tokens to be white listed and allow any word character …