I try to get string between <%= and %>, here is my implementation:
String str = \"ZZZZL <%= dsn %> AFFF <%= AFG %>\"; Pattern pattern = Patter
Your regex looks correct, but you're splitting with it instead of matching with it. You want something like this:
splitting
matching
// Untested code Matcher matcher = Pattern.compile("<%=(.*?)%>").matcher(str); while (matcher.find()) { System.out.println(matcher.group()); }