Class RegexpUtil

java.lang.Object
org.apache.drill.exec.expr.fn.impl.RegexpUtil

public class RegexpUtil extends Object
Utilities for converting SQL LIKE and SIMILAR operators to regular expressions.
  • Constructor Details

    • RegexpUtil

      public RegexpUtil()
  • Method Details

    • sqlToRegexLike

      public static RegexpUtil.SqlPatternInfo sqlToRegexLike(String sqlPattern)
      Translates a SQL LIKE pattern to Java regex pattern. No escape char.
    • sqlToRegexLike

      public static RegexpUtil.SqlPatternInfo sqlToRegexLike(String sqlPattern, CharSequence escapeStr)
      Translates a SQL LIKE pattern to Java regex pattern, with optional escape string.
    • sqlToRegexLike

      public static RegexpUtil.SqlPatternInfo sqlToRegexLike(String sqlPattern, char escapeChar)
      Translates a SQL LIKE pattern to Java regex pattern.
    • sqlToRegexSimilar

      public static String sqlToRegexSimilar(String sqlPattern)
      Translates a SQL SIMILAR pattern to Java regex pattern. No escape char.
    • sqlToRegexSimilar

      public static String sqlToRegexSimilar(String sqlPattern, CharSequence escapeStr)
      Translates a SQL SIMILAR pattern to Java regex pattern, with optional escape string.
    • sqlToRegexSimilar

      public static String sqlToRegexSimilar(String sqlPattern, char escapeChar)
      Translates SQL SIMILAR pattern to Java regex pattern.