Php 正则表达式,需要支持吗

Php 正则表达式,需要支持吗,php,regex,preg-replace,Php,Regex,Preg Replace,我有以下链接: /admin/index.php /admin/index.php?do=delete_user /forum/index.php?search=aaa&type=a /index.php /index.php?p=home 等等 如何preg_replace()只有index.php而没有GET的链接将发生更改(如果有GET'don'replace) 谢谢,它在工作,但是为什么不工作这个(?!&),(?!\&)?如果在asd.aa/index.php?news=1之后

我有以下链接:

/admin/index.php
/admin/index.php?do=delete_user
/forum/index.php?search=aaa&type=a
/index.php
/index.php?p=home
等等

如何preg_replace()只有index.php而没有GET的链接将发生更改(如果有GET'don'replace)


谢谢,它在工作,但是为什么不工作这个(?!&),(?!\&)?如果在asd.aa/index.php?news=1之后存在((asd.aa/index.php?news=1&dont=change),我想保持不变。

使用消极的前瞻:
'/index\.php(?)/“
将只在
index.php
之后没有
时匹配。我想你需要澄清这一点,因此,我们可以准确地理解您想要什么。您的问题不清楚,请添加示例输入和输出。请将标题更改为更具说明性。GETs的含义是什么?可能是查询字符串参数,或者实际上是http get请求?让我试着把它弄对。您想替换所有没有GET参数的链接,而只替换index.php来删除index.php,但是如果有GET参数,就不需要使用它了?