Skip to content
New issue

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

正则表达式中 \ 也会被吞 #335

Open
shenhuaxin opened this issue Jul 19, 2024 · 0 comments
Open

正则表达式中 \ 也会被吞 #335

shenhuaxin opened this issue Jul 19, 2024 · 0 comments

Comments

@shenhuaxin
Copy link

对于正则表达式的 \d 等符号也会丢失,有什么通用的方法解决转义符号丢失的问题吗

REPLACEREG("xxx4ch", '(\d*)ch', "中间包第$1炉")
public class ReplaceRegOperator extends Operator {

    @Override
    public Object executeInner(Object[] list) throws Exception {
        if (list == null) {
            return "";
        }
        if (list.length < 3) {
            return list[0];
        }
        return ReUtil.replaceAll((CharSequence) list[0], (String) list[1], (String) list[2]);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant