道路运输证ocr中交

This commit is contained in:
2024-11-20 08:32:05 +08:00
parent 5bc0a041de
commit 51075e72c8
4 changed files with 221 additions and 28 deletions
@@ -1,5 +1,6 @@
package com.dahe.mylibrary.utils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class PatternUtils {
@@ -25,4 +26,13 @@ public class PatternUtils {
public static boolean isLetter(String password){
return Pattern.matches(REGEX_WORD, password);
}
public static String getNumByStr(String str){
Pattern compile = Pattern.compile("\\d+");
Matcher matcher = compile.matcher(str);
while (matcher.find()) {
return matcher.group();
}
return "";
}
}