Class PatternMatchingFunctions


  • @Experimental
    @Public
    public class PatternMatchingFunctions
    extends Object
    DSL for N1QL functions in the Pattern Matching category. Pattern-matching functions allow you to work determine if strings contain a regular expression pattern. You can also find the first position of a regular expression pattern and replace a regular expression with another.
    Since:
    2.2
    Author:
    Simon Baslé
    • Method Detail

      • regexpContains

        public static Expression regexpContains​(Expression expression,
                                                String pattern)
        Returned expression results in True if the string value contains the regular expression pattern.
      • regexpContains

        public static Expression regexpContains​(String expression,
                                                String pattern)
        Returned expression results in True if the string value contains the regular expression pattern.
      • regexpLike

        public static Expression regexpLike​(Expression expression,
                                            String pattern)
        Returned expression results in True if the string value matches the regular expression pattern
      • regexpLike

        public static Expression regexpLike​(String expression,
                                            String pattern)
        Returned expression results in True if the string value matches the regular expression pattern
      • regexpPosition

        public static Expression regexpPosition​(Expression expression,
                                                String pattern)
        Returned expression results in the first position of the regular expression pattern within the string, or -1.
      • regexpPosition

        public static Expression regexpPosition​(String expression,
                                                String pattern)
        Returned expression results in the first position of the regular expression pattern within the string, or -1.
      • regexpReplace

        public static Expression regexpReplace​(Expression expression,
                                               String pattern,
                                               String repl,
                                               int n)
        Returned expression results in a new string with occurrences of pattern replaced with repl. At most n replacements are performed.
      • regexpReplace

        public static Expression regexpReplace​(String expression,
                                               String pattern,
                                               String repl,
                                               int n)
        Returned expression results in a new string with occurrences of pattern replaced with repl. At most n replacements are performed.
      • regexpReplace

        public static Expression regexpReplace​(Expression expression,
                                               String pattern,
                                               String repl)
        Returned expression results in a new string with all occurrences of pattern replaced with repl.
      • regexpReplace

        public static Expression regexpReplace​(String expression,
                                               String pattern,
                                               String repl)
        Returned expression results in a new string with all occurrences of pattern replaced with repl.