您可以尝试使用此正则表达式:
Matcher m = Pattern.compile("(\d{1,2}/\d{1,2}/\d{4}|\d{1,2}/\d{1,2})", Pattern.CASE_INSENSITIVE).matcher(string); while (m.find()) { System.out.println(m.group(1)); }它在寻找模式DD / MM或在寻找DD / MM / YYYY。
检查此链接

您可以尝试使用此正则表达式:
Matcher m = Pattern.compile("(\d{1,2}/\d{1,2}/\d{4}|\d{1,2}/\d{1,2})", Pattern.CASE_INSENSITIVE).matcher(string); while (m.find()) { System.out.println(m.group(1)); }它在寻找模式DD / MM或在寻找DD / MM / YYYY。
检查此链接