We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我想注册一个函数 来实现自定义的正则匹配逻辑,函数是这样的:
/** * 正则匹配 * * @param str 字符串 * @param reg 正则表达式 * @param allMatches 是否全文匹配 * @return 是否匹配 */ public static boolean matchPattern(String str, String reg, boolean allMatches) { if (StringUtils.isAnyEmpty(str, reg)) { return false; } Matcher matcher = Pattern.compile(reg).matcher(str); if (allMatches) { return matcher.matches(); } else { return matcher.find(); } }
当使用aviator表达式编译时 正则中的一些转义会抛出不支持的异常 比如这个表达式
return matchPattern('很好', '[\u4e00-\u9fa5]{0,4}'); // 0-4个中文字符
其中\u会被解析器抛出无法识别异常
请教下:如果移除源码中的 throw逻辑 ,可能会有哪些影响呢 com/googlecode/aviator/lexer/ExpressionLexer.java:394
com/googlecode/aviator/lexer/ExpressionLexer.java:394
The text was updated successfully, but these errors were encountered:
加个 \ 呢?
\
Sorry, something went wrong.
No branches or pull requests
问题
我想注册一个函数 来实现自定义的正则匹配逻辑,函数是这样的:
当使用aviator表达式编译时 正则中的一些转义会抛出不支持的异常 比如这个表达式
其中\u会被解析器抛出无法识别异常
思路
请教下:如果移除源码中的 throw逻辑 ,可能会有哪些影响呢
com/googlecode/aviator/lexer/ExpressionLexer.java:394
The text was updated successfully, but these errors were encountered: