@Test public void getRegex() throws Exception { Pattern simple = RegexUtil.getRegex("simple"); Assert.assertNull(simple); Pattern star = RegexUtil.getRegex("dev.*"); Assert.assertNotNull(star); }
public static Pattern getRegex(String input) { Matcher matcher = pattern.matcher(input); if (!matcher.find()) { return null; } try { return Pattern.compile(input); } catch (PatternSyntaxException e) { return null; } }
RegexUtil { public static Pattern getRegex(String input) { Matcher matcher = pattern.matcher(input); if (!matcher.find()) { return null; } try { return Pattern.compile(input); } catch (PatternSyntaxException e) { return null; } } }
RegexUtil { public static Pattern getRegex(String input) { Matcher matcher = pattern.matcher(input); if (!matcher.find()) { return null; } try { return Pattern.compile(input); } catch (PatternSyntaxException e) { return null; } }  }
RegexUtil { public static Pattern getRegex(String input) { Matcher matcher = pattern.matcher(input); if (!matcher.find()) { return null; } try { return Pattern.compile(input); } catch (PatternSyntaxException e) { return null; } }  static Pattern getRegex(String input); static Pattern env(); static boolean isClassName(String consumerId); }
RegexUtil { public static Pattern getRegex(String input) { Matcher matcher = pattern.matcher(input); if (!matcher.find()) { return null; } try { return Pattern.compile(input); } catch (PatternSyntaxException e) { return null; } }  static Pattern getRegex(String input); static Pattern env(); static boolean isClassName(String consumerId);  }