@Test public void testCreatePatternWithSingleWildcard() { Pattern pattern = UserSearchUtils.createPattern("*", true, CASE_SENSITIVE); assertFalse(pattern.matcher("").matches()); assertTrue(pattern.matcher(" ").matches()); assertTrue(pattern.matcher("b").matches()); assertTrue(pattern.matcher("bb").matches()); assertTrue(pattern.matcher("boob").matches()); assertTrue(pattern.matcher("bob").matches()); assertTrue(pattern.matcher("xbob").matches()); assertTrue(pattern.matcher("xxbob").matches()); }
public static Pattern createPattern(String input, boolean allowGlobbing, int options) { Pattern wildCardPattern = createSingleStarPattern(input, allowGlobbing, options); if (wildCardPattern != null) { return wildCardPattern; } String converted = convertUserInputToRegex(input, allowGlobbing); Pattern p = Pattern.compile(converted, options); return p; }
UserSearchUtils { public static Pattern createPattern(String input, boolean allowGlobbing, int options) { Pattern wildCardPattern = createSingleStarPattern(input, allowGlobbing, options); if (wildCardPattern != null) { return wildCardPattern; } String converted = convertUserInputToRegex(input, allowGlobbing); Pattern p = Pattern.compile(converted, options); return p; } }
UserSearchUtils { public static Pattern createPattern(String input, boolean allowGlobbing, int options) { Pattern wildCardPattern = createSingleStarPattern(input, allowGlobbing, options); if (wildCardPattern != null) { return wildCardPattern; } String converted = convertUserInputToRegex(input, allowGlobbing); Pattern p = Pattern.compile(converted, options); return p; }  }
UserSearchUtils { public static Pattern createPattern(String input, boolean allowGlobbing, int options) { Pattern wildCardPattern = createSingleStarPattern(input, allowGlobbing, options); if (wildCardPattern != null) { return wildCardPattern; } String converted = convertUserInputToRegex(input, allowGlobbing); Pattern p = Pattern.compile(converted, options); return p; }  static Pattern createSearchPattern(String input, boolean caseSensitive); static Pattern createLiteralSearchPattern(String text); static Pattern createStartsWithPattern(String input, boolean allowGlobbing,
			int options); static Pattern createEndsWithPattern(String input, boolean allowGlobbing, int options); static Pattern createContainsPattern(String input, boolean allowGlobbing, int options); static Pattern createPattern(String input, boolean allowGlobbing, int options); static String createPatternString(String input, boolean allowGlobbing); }
UserSearchUtils { public static Pattern createPattern(String input, boolean allowGlobbing, int options) { Pattern wildCardPattern = createSingleStarPattern(input, allowGlobbing, options); if (wildCardPattern != null) { return wildCardPattern; } String converted = convertUserInputToRegex(input, allowGlobbing); Pattern p = Pattern.compile(converted, options); return p; }  static Pattern createSearchPattern(String input, boolean caseSensitive); static Pattern createLiteralSearchPattern(String text); static Pattern createStartsWithPattern(String input, boolean allowGlobbing,
			int options); static Pattern createEndsWithPattern(String input, boolean allowGlobbing, int options); static Pattern createContainsPattern(String input, boolean allowGlobbing, int options); static Pattern createPattern(String input, boolean allowGlobbing, int options); static String createPatternString(String input, boolean allowGlobbing); final static String STAR; final static Pattern NON_GLOB_BACKSLASH_PATTERN; }