This commit is contained in:
Looly
2020-03-13 17:47:57 +08:00
parent cefe1311ad
commit aaee713fad
7 changed files with 104 additions and 104 deletions

View File

@@ -61,6 +61,8 @@ public class PatternPool {
public final static Pattern PLATE_NUMBER = Pattern.compile(
//https://gitee.com/loolly/hutool/issues/I1B77H?from=project-issue
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
//https://gitee.com/loolly/hutool/issues/I1BJHE?from=project-issue
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]\\d{3}\\d{1,3}[领])|" +
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$");
// -------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -134,5 +134,6 @@ public class ValidatorTest {
@Test
public void isPlateNumberTest(){
Assert.assertTrue(Validator.isPlateNumber("粤BA03205"));
Assert.assertTrue(Validator.isPlateNumber("闽20401领"));
}
}

View File

@@ -12,11 +12,11 @@ public class PageUtilTest {
@Test
public void transToStartEndTest(){
int[] startEnd1 = PageUtil.transToStartEnd(1, 10);
int[] startEnd1 = PageUtil.transToStartEnd(0, 10);
Assert.assertEquals(0, startEnd1[0]);
Assert.assertEquals(10, startEnd1[1]);
int[] startEnd2 = PageUtil.transToStartEnd(2, 10);
int[] startEnd2 = PageUtil.transToStartEnd(1, 10);
Assert.assertEquals(10, startEnd2[0]);
Assert.assertEquals(20, startEnd2[1]);
}