mirror of
				https://github.com/dromara/RuoYi-Vue-Plus.git
				synced 2025-11-04 16:23:42 +08:00 
			
		
		
		
	update 优化 RegexUtils#extractFromString 方法未匹配返回null不返回默认值问题
This commit is contained in:
		@@ -21,7 +21,8 @@ public final class RegexUtils extends ReUtil {
 | 
			
		||||
     */
 | 
			
		||||
    public static String extractFromString(String input, String regex, String defaultInput) {
 | 
			
		||||
        try {
 | 
			
		||||
            return ReUtil.get(regex, input, 1);
 | 
			
		||||
            String str = ReUtil.get(regex, input, 1);
 | 
			
		||||
            return str == null ? defaultInput : str;
 | 
			
		||||
        } catch (Exception e) {
 | 
			
		||||
            return defaultInput;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user