java出⽣⽇期验证,验证⽇期的Java正则表达式看⽕龙果写了⼀个验证⽇期的Java正则表达式,就给转了过来
由于使⽤到了反向预搜索模式“(?<=)”和“(?
下⾯是源代码:
import Matcher;
import Pattern;
public class DateRegex {
public static void main(String[] args) {
String[] str = {
"2001-0-0", "2001-1-1", "2001-1-30", "2001-1-31",
"2001-1-32", "2001-2-1", "2001-2-27", "2001-2-28",
"2004-2-29", "2001-2-29", "2001-2-30", "2001-2-31",
"2001-2-32", "2001-3-1", "2001-3-10", "2001-3-29",
"2001-3-30", "2001-3-31", "2001-3-32", "2001-4-1",
"2001-4-10", "2001-4-29", "2001-4-30", "2001-4-31",
"2001-4-32", "2001-5-1", "2001-5-10", "2001-5-29",
"2001-5-30", "2001-5-31", "2001-5-32", "2001-6-1",
"2001-6-10", "2001-6-29", "2001-6-30", "2001-6-31",
"2001-6-32", "2001-7-1", "2001-7-10", "2001-7-29",
"2001-7-30", "2001-7-31", "2001-7-32", "2001-8-1",
"2001-8-10", "2001-8-29", "2001-8-30", "2001-8-31",
"2001-8-32", "2001-9-1", "2001-9-10", "2001-9-29",
"2001-9-30", "2001-9-31", "2001-9-32", "2001-10-1",
"2001-10-10", "2001-10-29", "2001-10-30", "2001-10-31",
"2001-10-32", "2001-11-1", "2001-11-10", "2001-11-29",
"2001-11-30", "2001-11-31", "2001-11-32", "2001-12-1",
时间正则表达式java"2001-12-10", "2001-12-29", "2001-12-30", "2001-12-31",
"20
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论