Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.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 正则表达式-查找和替换字符串_Regex_Command Line - Fatal编程技术网

Regex 正则表达式-查找和替换字符串

Regex 正则表达式-查找和替换字符串,regex,command-line,Regex,Command Line,我正在尝试搜索我的服务器,并在任何文件中找到以下内容 我的正则表达式 grep-H-r'/\/gi'/var/www/html/optinsmart/ 我正在寻找这个,我想什么都不替换它,或者干脆删除它 它不会在命令行返回任何匹配项 但是当我执行grep'时,您可以使用grep-F(不带正则表达式的固定字符串): grep-FHr'我在找这个。请具体说明您想要实现什么,而不是仅仅参考您的正则表达式。但我需要获得整个PHP代码和???可能是任何东西。。gh32947gh9h 0r一个单词、数字或

我正在尝试搜索我的服务器,并在任何文件中找到以下内容

我的正则表达式
grep-H-r'/\/gi'/var/www/html/optinsmart/

我正在寻找这个
,我想什么都不替换它,或者干脆删除它

它不会在命令行返回任何匹配项


但是当我执行
grep'时,您可以使用
grep-F
(不带正则表达式的固定字符串):


grep-FHr'我在找这个。请具体说明您想要实现什么,而不是仅仅参考您的正则表达式。但我需要获得整个PHP代码<代码>
和???可能是任何东西。。gh32947gh9h 0r一个单词、数字或破折号…但即使这一行也是以相同的文本开头的
,所以with将只转到行的末尾?我的服务器被黑客攻击,该代码片段被添加到所有index.php文件的底部。所以我想搜索它并将其从所有文件中删除。。您对此有何建议?我最终使用了
find./-name“index.php”| xargs sed-i'/
grep -FHr '<?php preg_replace("/.*/e"' *
sed -i.bak '/<?php preg_replace("\/.*\/e"/d' *