代码如下:
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class App {
public static void main(String[] args) {
String str = "341322001028 ";
Pattern pattern = Pattern.compile("]*>([^<]+) ");
Matcher matcher = pattern.matcher(str);
if (matcher.find()) {
String val = matcher.group(1);
System.out.println(val);
}
}
}
运行结果: