开发者

uniq char that need to replaced without to put the "\"

I need to know if there is some way to replace any string as @ or * or ? or & without to put th开发者_开发技巧e "\" before it

Example

perl -pe 'next if /^#/; s/\@d\&/new_value/ if /param5/'  test

in this example need to replace the @d& with new_value

but I need to put the "\" before @ or &

can be other way without to put the "\" because I have random char that can be in the old value.


perl -pe 'next if /^#/; my $regex=q/@d&/; s/$regex/new_value/ if /param5/'  test
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜