Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 跳过这句话;Unmatched(在正则表达式中;在perl中标记为<;--HERE in";error_Regex_Perl - Fatal编程技术网

Regex 跳过这句话;Unmatched(在正则表达式中;在perl中标记为<;--HERE in";error

Regex 跳过这句话;Unmatched(在正则表达式中;在perl中标记为<;--HERE in";error,regex,perl,Regex,Perl,我必须用新字符串替换文件中的某些字符串 $tobereplaced="SFK_DFKDG_ASDf(SDGFds gfd"; #example string $replace="SFK_DFKDG_ASDf(SDGFds gfd processed"; #example String $value =~ s/$tobereplaced/$replace/g; 在替换时,我遇到了这个错误 不匹配(在正则表达式中;标记为使用\Q元字符禁用搜索字符串中的模式元字符并执行文字字符串替换: $va

我必须用新字符串替换文件中的某些字符串

 $tobereplaced="SFK_DFKDG_ASDf(SDGFds gfd"; #example string
 $replace="SFK_DFKDG_ASDf(SDGFds gfd processed"; #example String
 $value =~ s/$tobereplaced/$replace/g;
在替换时,我遇到了这个错误
不匹配(在正则表达式中;标记为使用
\Q
元字符禁用搜索字符串中的模式元字符并执行文字字符串替换:

$value =~ s/\Q$tobereplaced/$replace/g;
可以找到更多信息