Dreamweaver Regex Find and Replace with Regular Expression

三世轮回 提交于 2019-12-11 08:42:23

问题


I have many instances throughout my site where I have inadvertently included the following code:

if (isset(htmlspecialchars($_GET['u'])))

I need to do a widespread find/replace to turn that code into this:

if (isset($_GET['u']))

I am trying to use the code below to find with Regular Expressions, but it only comes up if I don't include the htmlspecialchars and parentheses.

  • Find: htmlspecialchars(\$_GET['([^']*)'])
  • Replace: $_GET['$1']

Any ideas? Thanks!


回答1:


() and [] need to be escaped.

isset\(htmlspecialchars\(\$_GET\['([^']*)'\]\)\)


来源:https://stackoverflow.com/questions/13676555/dreamweaver-regex-find-and-replace-with-regular-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!