问题
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