How to replace in all files rearranging variables (a1, b1) to (b1, a1) ?

I do not know what this would be called but I have a situation like this:




mysql_query($qryName, $db)


I need to change that to



mysqli_query($db, $qryName)




The thing is $qryName is different all throughout my project, is there a way to tell phpStorm to do the following?


FYI: I am using the find replace tool for this.




Text To Find:


mysql_query(*, $db)


Replace With:


mysqli_query($db, *)

3 comments

just use regular expression mode for search and replace.
(do not forget to set 'Regular expression' check box in search dialog)

mysql_query\((.*), \$db\)
->
mysql_query(\\$db, $1)

0

$n is a reference to n-th capture group from search expression, just as stated in help for replace field for the search/replace dialog.

0

Please sign in to leave a comment.