Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想 $_POST['a-z']用mysqli_real_escape_string($_POST['a-z']).
$_POST['a-z']
mysqli_real_escape_string($_POST['a-z'])
因此,替换将mysqli_real_escape_string(在开始和 )结束时添加"]"- 保持不变,所有这一切都在这之间 ['']
mysqli_real_escape_string(
)
"]"
['']
在 phpstorm 中执行此操作的正则表达式是什么?
搜索模式:(\$_POST\['[a-zA-Z0-9_-]+'\])
(\$_POST\['[a-zA-Z0-9_-]+'\])
替换字符串:mysqli_real_escape_string($1)
mysqli_real_escape_string($1)
$_POST['a-z']这将替换, $_POST['aaa'],之类的字符串$_POST['Hello-Pink_Kitten99']。如果您还需要匹配其他字符 - 根据需要调整模式。
$_POST['aaa']
$_POST['Hello-Pink_Kitten99']