enhancement #I5GBXI 支持EL中任意地方的注释

This commit is contained in:
tangkc 2022-07-12 09:20:48 +08:00
parent 7e93fedc62
commit ab073301b0
1 changed files with 2 additions and 2 deletions

View File

@ -393,7 +393,7 @@ public class ParserHelper {
private static class RegexUtil{
// java 注释的正则表达式
private static final String REGEX_NOTE = "/\\*((?!\\*/).|[\\r\\n])*?\\*/|[ \\t]*//.*";
private static final String REGEX_COMMENT = "/\\*((?!\\*/).|[\\r\\n])*?\\*/|[ \\t]*//.*";
/**
* 移除 el 表达式中的注释支持 java 的注释包括单行注释多行注释
@ -407,7 +407,7 @@ public class ParserHelper {
return elStr;
}
String text = Pattern.compile(REGEX_NOTE)
String text = Pattern.compile(REGEX_COMMENT)
.matcher(elStr)
// 移除注释
.replaceAll(CharSequenceUtil.EMPTY)