我发现了一个Java正则表达式的代码,它让我感到困惑:
什么是“”的含义?
Pattern.compile( "J.*\\d[0-35-9]-\\d\\d-\\d\\d" );
需要编译的字符串是:
String string1 = "Jane's Birthday is 05-12-75\n" + "Dave's Birthday is 11-04-68\n" + "John's Birthday is 04-28-73\n" + "Joe's Birthday is 12-17-77";
什么是“”的含义?
[0-35-9]
为什么有四个"\d"而不是三个?我假设生日中只有三个数字。