void () { for (char i = 0; i < 256; i++) { if (i == '?' || i == '*') continue; String str = "x" + i + "y"; assertTrue("char: " + i + "(" + (int)i + ")", PatternUtil.fromMask(str).matcher(str).matches()); } String allSymbols = "+.\\*/^?$[]()"; assertTrue(PatternUtil.fromMask(allSymbols).matcher(allSymbols).matches()); Pattern pattern = PatternUtil.fromMask("?\\?/*"); assertTrue(pattern.matcher("a\\b/xyz").matches()); assertFalse(pattern.matcher("x/a\\b").matches()); }