I ve read Quote and Quote-like Operators in man perlop
but can t figure out how to use s/.../EXPR/e
if EXPR contains code which itself contains a substitution involving both A and the outer substitution delimiters:
perl -E say "{foo}" =~ s{.+}{local $_=$&; s/{/LB/;$_ }er;
页: 1
如果我尝试使用<代码>。 A
perl -E say "{foo}" =~ s{.+}{local $_=$&; s/A{/LB/;$_ }er;
reg reg reg
Adding additional backslashes before A
does not help.
在<代码>{之前添加斜线 似乎也没有工作:
perl -E say "{foo}" =~ s{.+}{local $_=$&; s/A\{/LB/;$_ }er;
查阅<代码>替代物,但不终止<>/代码>(合理足够),但
perl -E say "{foo}" =~ s{.+}{local $_=$&; s/A\{/LB/;$_ }er;
汇编但并不匹配(产出为{foo}
而不是LBfoo}
)。
在“未终止”的错误与无声不匹配之间添加斜线。
谁会发现问题?