From 163dff00bdc5204f8c536c01529daa0fce95f994 Mon Sep 17 00:00:00 2001 From: Looly Date: Thu, 24 Mar 2022 09:37:26 +0800 Subject: [PATCH] fix re --- hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java b/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java index be915ad2a..b34ec1fe0 100644 --- a/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java +++ b/hutool-http/src/main/java/cn/hutool/http/HtmlUtil.java @@ -127,10 +127,10 @@ public class HtmlUtil { // (?i)表示其后面的表达式忽略大小写 if (withTagContent) { // 标签及其包含内容 - regex = StrUtil.format("(?i)<{}(\\s+[^>]*)?/?>(.*?)?", tagName, tagName); + regex = StrUtil.format("(?i)<{}(\\s+[^>]*?)?/?>(.*?)?", tagName, tagName); } else { // 标签不包含内容 - regex = StrUtil.format("(?i)<{}(\\s+[^>]*)?/?>|", tagName, tagName); + regex = StrUtil.format("(?i)<{}(\\s+[^>]*?)?/?>|", tagName, tagName); } content = ReUtil.delAll(regex, content); // 非自闭标签小写