static String hexDecoder(String line) throws Exception { if (line == null) throw new ArgumentNullException(); // parse looking for =XX where XX is hexadecimal Pattern re = Pattern.compile("(\\=([0-9A-F][0-9A-F]))", Pattern.CASE_INSENSITIVE); return re.Replace(line, new MatchEvaluator(HexDecoderEvaluator)); }