我有一个字符串,如下所示,
$str = 'dev-phase-to-improve == "NOTEQUAL"'
我想替换:
dev-phase-to-improve == "NOTEQUAL"
到
!dev-phase-to-improve=""
想知道我怎么能这样做,我的代码就像下面所示,
$rc_link =~ s/'dev-phase-to-improve == "NOTEQUAL"/!dev-phase-to-improve=""/ig;
但它不起作用。有什么想法吗?
答案 0 :(得分:1)
它正在运作,请查看
my $str = 'dev-phase-to-improve == "NOTEQUAL"';
$str=~ s/dev-phase-to-improve == "NOTEQUAL"/\!dev-phase-to-improve=""/g;
print $str."\n";