Create regular expression equivalent to any like operator string match
function.

@param expr
the expr
@param ignoreCase
whether to ignore the case
@return the string
192978
public static String createLikeRegex(String expr, boolean ignoreCase)
    {
        String regex = createRegex(expr, ignoreCase);
        regex = regex.replace("_", ".").replace("%", ".*?");

        return regex;
    }
843001
public BooleanExpression likeIgnoreCase(Expression<String> str) {
        return Expressions.booleanOperation(Ops.LIKE_IC, mixin, str);
    }
1113674
def _get_string_match_value(self, string, string_match_type):
        """"""
        if string_match_type == Type(**get_type_data('EXACT')):
            return string
        elif string_match_type == Type(**get_type_data('IGNORECASE')):
            return re.compile('^' + string, re.I)
        elif string_match_type == Type(**get_type_data('WORD')):
            return re.compile('.*' + string + '.*')
        elif string_match_type == Type(**get_type_data('WORDIGNORECASE')):
            return re.compile('.*' + string + '.*', re.I)
782146
public static String createRegex(String value, boolean ignoreCase)
    {
        if (value == null)
        {
            throw new IllegalArgumentException("String cannot be null");
        }

        int len = value.length();
        if (len == 0)
        {
            return "";
        }

        StringBuilder sb = new StringBuilder(len * 2);

        if (ignoreCase)
        {
            sb.append("(?i)");
        }

        sb.append("^");

        for (int i = 0; i < len; i++)
        {
            char c = value.charAt(i);
            if ("[](){}.*+?$^|#\\".indexOf(c) != -1)
            {
                sb.append("\\");
            }
            sb.append(c);
        }
        sb.append("$");
        return sb.toString();
    }
133909
public RegexMatcher addExpression(String expr, T attach, Option... options)
    {
        if (nfa == null)
        {
            nfa = parser.createNFA(nfaScope, expr, attach, options);
        }
        else
        {
            NFA<T> nfa2 = parser.createNFA(nfaScope, expr, attach, options);
            nfa = new NFA<>(nfaScope, nfa, nfa2);
        }
        return this;
    }
889777
function( pattern, ignoreCase ) {
					var overlap = [ -1 ];
					if ( ignoreCase )
						pattern = pattern.toLowerCase();
					for ( var i = 0; i < pattern.length; i++ ) {
						overlap.push( overlap[ i ] + 1 );
						while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
							overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1;
					}

					this._ = {
						overlap: overlap,
						state: 0,
						ignoreCase: !!ignoreCase,
						pattern: pattern
					};
				}
95268
public Operator createLikeOperator(Selector ar, String pattern, boolean escaped, char escape)
  {
  Object parsed = Pattern.parsePattern(pattern, escaped, escape);
  if (parsed == null)
    return null;
  else if (parsed == Pattern.matchMany)
    return createOperator(Selector.NOT, createOperator(Selector.ISNULL, ar));
  else if (parsed instanceof String)
    return createOperator(Selector.EQ, ar, createLiteral(parsed));
  else
    return new LikeOperatorImpl(Selector.LIKE, ar, (Pattern) parsed, pattern,
      escaped, escape);
  }
1283304
public static Expression regexpPosition(String expression, String pattern) {
        return regexpPosition(x(expression), pattern);
    }
93792
def _regexp(expr, item):
    ''' 
    '''
    reg = re.compile(expr)
    return reg.search(item) is not None
950013
public static Expression regexpReplace(Expression expression, String pattern, String repl) {
        return x("REGEXP_REPLACE(" + expression.toString() + ", \"" + pattern + "\", \"" + repl + "\")");
    }
892284
public static <I,O> BoolExprPattern<I,O> matches(Function<I,Boolean> expr, Function<I,O> f) {
        return new BoolExprPattern<I, O>(expr, f);
    }
1312910
public static boolean matchAny(final String pattern, final String[] candidate, boolean ignoreCase) {

        for (int i = 0; i < candidate.length; i++) {
            final String string = candidate[i];
            if (match(pattern, string, ignoreCase)) {
                return true;
            }
        }

        return false;
    }
653242
public static <T extends NamedElement> ElementMatcher.Junction<T> nameContainsIgnoreCase(String infix) {
        return new NameMatcher<T>(new StringMatcher(infix, StringMatcher.Mode.CONTAINS_IGNORE_CASE));
    }
469897
public BooleanExpression likeIgnoreCase(String str) {
        return Expressions.booleanOperation(Ops.LIKE_IC, mixin, ConstantImpl.create(str));
    }
1351539
public BooleanExpression containsIgnoreCase(Expression<String> str) {
        return Expressions.booleanOperation(Ops.STRING_CONTAINS_IC, mixin, str);
    }
700229
public static <T> ExampleExpression exampleExpression(EbeanServer ebeanServer, Example<T> example) {
        LikeType likeType;
        switch (example.getMatcher().getDefaultStringMatcher()) {
            case EXACT:
                likeType = LikeType.EQUAL_TO;
                break;
            case CONTAINING:
                likeType = LikeType.CONTAINS;
                break;
            case STARTING:
                likeType = LikeType.STARTS_WITH;
                break;
            case ENDING:
                likeType = LikeType.ENDS_WITH;
                break;
            default:
                likeType = LikeType.RAW;
                break;
        }
        return ebeanServer.getExpressionFactory().exampleLike(example.getProbe(),
                example.getMatcher().isIgnoreCaseEnabled(),
                likeType);
    }
807058
public static RegexpMatcher getMatcher( String pattern, boolean multiline ) {
      if( isJDK13() ){
         return new Perl5RegexpMatcher( pattern, true );
      }else{
         return new JdkRegexpMatcher( pattern, true );
      }
   }