You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/09/06 15:50:08 UTC

[GitHub] yanghua commented on a change in pull request #6659: [FLINK-10281] [table] Table function parse regular expression contains backslash failed

yanghua commented on a change in pull request #6659: [FLINK-10281] [table] Table function parse regular expression contains backslash failed
URL: https://github.com/apache/flink/pull/6659#discussion_r215679341
 
 

 ##########
 File path: flink-libraries/flink-table/src/main/scala/org/apache/flink/table/expressions/ExpressionParser.scala
 ##########
 @@ -186,7 +186,7 @@ object ExpressionParser extends JavaTokenParsers with PackratParsers {
       }
 
   lazy val singleQuoteStringLiteral: Parser[Expression] =
-    ("'" + """([^'\p{Cntrl}\\]|\\[\\'"bfnrt]|\\u[a-fA-F0-9]{4})*""" + "'").r ^^ {
+    ("'" + """([^'\p{Cntrl}]|\\[\\'"bfnrt]|\\u[a-fA-F0-9]{4})*""" + "'").r ^^ {
 
 Review comment:
   I don't know if modifying the scala library will have a bigger impact. In fact, looking at this line, we are already customizing (expanding) this regular expression. My personal suggestion is that we only modify this regular expression for single quotes. (At the moment we only found problems in the single quotes scenario), and other forms have not been found, and it has passed all test cases, so it can be said that this change has no effect on other current parsing cases. But if we don't modify it, then all parsing of `\d`, '\w' and other regulars beginning with a backslash are wrong.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services