//replace all \/'s with a temporary ~ so that we don't split on those
String pattern = sPattern.replaceAll("\\\\/", "~");
String[] sub = pattern.split("/");
if (sub.length<2 || !sub[0].equals("s")) {
throw new DefaultChannelInvalidConfigException("Malformed pathTransform expression. Expected \"s/from/to\"");
}
String from = sub[1].replaceAll("~", "/");
String to = (sub.length>2) ? sub[2] : "";
to = to.replaceAll("~", "/");