boolean (String text, char... cs) { boolean slash = false; for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); if (ch == '\\') { slash = !slash; } else { if (!slash) { for (char c : cs) { if (ch == c) return true; } } slash = false; } } return false; }