mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix re
This commit is contained in:
parent
d4a24180a4
commit
163dff00bd
@ -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); // 非自闭标签小写
|
||||
|
Loading…
x
Reference in New Issue
Block a user