rythmengine/rythmengine · CodeBuilder.java
java logo
@SuppressWarnings("unused")
    private static boolean isArray(String type) {
        Regex regex = new Regex(".*(?@[])");
        return regex.search(type);
    }
Similar code snippets
1.
paoding-code/paoding-rose · RegexMapping.java
Match rating: 70.6% · See similar code snippets
java logo
private String xx(String regex) {
        if (regex == null || regex.length() == 0) {
            regex = "[^/]+";
        } else if ("+".equals(regex)) {
            regex = ".+";
        } else if ("?".equals(regex)) {
            regex = ".?";
        } else if ("*".equals(regex)) {
            regex = ".*";
        } else if ("n".equals(regex) || "number".equals(regex)) {
            regex = "[0-9]+";
        } else if ("w".equals(regex) || "word".equals(regex)) {
            regex = "\\w+";
        } else if ("id".equals(regex)) {
            regex = "[0-9a-zA-Z_-]+";
        }
        return regex;
    }
2.
Netflix/spectator · TagMeasurementFilter.java
Match rating: 66.51% · See similar code snippets
java logo
private static Pattern regexToPatternOrNull(String regex) {
    if (regex != null && !regex.isEmpty() && !regex.equals(".*")) {
      return Pattern.compile(regex);
    }
    return null;
  }
3.
webmetrics/browsermob-proxy · UASparser.java
Match rating: 65.05% · See similar code snippets
java logo
private String convertPerlToJavaRegex(String regex) {
		regex = regex.substring(1);
		int lastIndex = regex.lastIndexOf('/');
		regex = regex.substring(0, lastIndex);
		return regex;
	}
4.
fedups/com.obdobion.argument · WildPath.java
Match rating: 64.6% · See similar code snippets
java logo
public static Pattern convertFileWildCardToRegx(final String wildcard)
    {
        String regex = wildcard;
        regex = regex.replaceAll("[.]", "\\\\.");
        regex = regex.replaceAll("[?]", ".");
        regex = regex.replaceAll("[*]", ".*");
        return Pattern.compile("^" + regex + "$", Pattern.CASE_INSENSITIVE);
    }
private static Pattern buildPattern(String regex) {
		if (regex == null || regex.isEmpty())
			return null;
		return Pattern.compile(regex);
	}
6.
seedstack/seed · ProxyManager.java
Match rating: 62.93% · See similar code snippets
java logo
private Pattern makePattern(String noProxy) {
        String regex = noProxy.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*");
        if (!regex.startsWith(".*")) {
            regex = ".*" + regex;
        }
        regex = "^" + regex + "$";
        return Pattern.compile(regex);
    }
7.
hawkular/hawkular-apm · AbstractAnalyticsService.java
Match rating: 62.36% · See similar code snippets
java logo
protected static String createRegex(String endpoint, boolean meta) {
        StringBuilder regex = new StringBuilder();

        regex.append('^');

        for (int i=0; i < endpoint.length(); i++) {
            char ch=endpoint.charAt(i);
            if ("*".indexOf(ch) != -1) {
                regex.append('.');
            } else if ("\\.^$|?+[]{}()".indexOf(ch) != -1) {
                regex.append('\\');
            }
            regex.append(ch);
        }

        regex.append('$');

        return regex.toString();
    }
8.
prestodb/presto · LikeFunctions.java
Match rating: 62.3% · See similar code snippets
java logo
private static boolean regexMatches(Regex regex, byte[] bytes)
    {
        return regex.matcher(bytes).match(0, bytes.length, Option.NONE) != -1;
    }
9.
jparsec/jparsec · Patterns.java
Match rating: 62.23% · See similar code snippets
java logo
public static Pattern regex(String s) {
    return regex(java.util.regex.Pattern.compile(s));
  }
10.
apache/flink · SqlFunctionUtils.java
Match rating: 61.74% · See similar code snippets
java logo
public static Boolean regExp(String s, String regex){
		if (regex.length() == 0) {
			return false;
		}
		try {
			return (REGEXP_PATTERN_CACHE.get(regex)).matcher(s).find(0);
		} catch (Exception e) {
			LOG.error("Exception when compile and match regex:" +
				regex + " on: " + s, e);
			return false;
		}
	}