mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2026-05-29 18:57:11 +08:00
RegexPool.PLATE_NUMBER新增粤AP号段支持(issue#IJNDJR@Gitee)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
|
||||
# 🚀Changelog
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
# 5.8.45(2026-05-09)
|
||||
# 5.8.45(2026-05-14)
|
||||
### 🐣新特性
|
||||
* 【core 】 `AnnotationUtil`新增两级缓存架构,提升高频注解解析性能(pr#1434@Gitee)
|
||||
* 【core 】 `RegexPool.PLATE_NUMBER`新增粤AP号段支持(issue#IJNDJR@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【db 】 修复`Page`和`PageResult`首页调用问题(issue#IH7A18@Gitee)
|
||||
|
||||
@@ -145,7 +145,7 @@ public interface RegexPool {
|
||||
*/
|
||||
String PLATE_NUMBER =
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I1B77H?from=project-issue
|
||||
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJK]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
|
||||
"^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[ABCDEFGHJK])|([ABCDEFGHJKP]([A-HJ-NP-Z0-9])[0-9]{4})))|" +
|
||||
//https://gitee.com/chinabugotech/hutool/issues/I1BJHE?from=project-issue
|
||||
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领]\\d{3}\\d{1,3}[领])|" +
|
||||
"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$";
|
||||
|
||||
@@ -167,6 +167,15 @@ public class ValidatorTest {
|
||||
assertTrue(Validator.isPlateNumber("闽20401领"));
|
||||
//issue#3979
|
||||
assertTrue(Validator.isPlateNumber("沪AE22075"));
|
||||
|
||||
// issue#IJNDJR
|
||||
assertTrue(Validator.isPlateNumber("粤AP00000"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP00001"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP10000"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP20000"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP30000"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP40000"));
|
||||
assertTrue(Validator.isPlateNumber("粤AP50000"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user