import java.util.regex.*; public class RegexTest { public static void main(String[] args) { String str = "fjei412fjdvnidao8464grgs23grgr5335"; Pattern p = Pattern.compile("//d+"); Matcher m = p.matcher(str); while (m.find()) { System.out.println(m.start() + "->" + m.end()); } } }
正则表达式
最新推荐文章于 2024-08-23 22:37:08 发布