package javaforum.org.example;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test {
public static void main(String[] args) {
String text = "<classfile class=\"Foo\" author=\"Darknet\">\n" +
"<classfile class=\"Bar\" author=\"MoxxiManagarm\">";
Pattern pattern = Pattern.compile("(?<=class=\")\\w+(?=\")");
Matcher matcher = pattern.matcher(text);
while(matcher.find()) {
System.out.println("Found class " + matcher.group());
}
}
}
Found class Foo
Found class Bar