I want to match a pattern for a string in Java. The format of the string will be like this.
"INSERT %ABC% %DEF%"
I want to be able to take strings ABC and DEF between the two set of '%'
public void parseInput(String input){
Pattern p = Pattern.compile("?: .* %(.*)%)*");
Matcher m = p.matcher(input);
String s1 = m.group(1);
String s2 = m.group(2);
}
I've played around so far, and continue to get syntax errors. In this case, this has been my most recent attempt, having gotten a dangling meta character error message