/** * convienience method to escape any character that is special to the regex system. * * @param inString the string to fix * @return the fixed string */ private static String fixSpecials(final String inString) { StringBuffer tmp = new StringBuffer(""); for (int i = 0; i < inString.length(); i++) { char chr = inString.charAt(i); if (isSpecial(chr)) { tmp.append("\\" + chr); } else { tmp.append(chr); } } return tmp.toString(); }