直接上代码:
String string = "asdasd#_%12.gifdadsa#_%2324.gif"; String regx = "#_%\\d+.gif"; Pattern pattern = Pattern.compile(regx,Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(string); while(matcher.find()){ System.out.println(matcher.group()); }原文链接:https://www.f2er.com/regex/361743.html