String pat = "/"+ISO8601_PAT +"/"; if(util.match(pat, in)) { return util.substitute("s/"+ISO8601_PAT+"//", in); } else { return in; }