Java trouve une sous-chaîne entre deux chaînes

StringUtils.substringBetween(str, "<%=", "%>");
Old-fashioned Oryx