You can inveter the arguments by creating three groups at the end simply format the substitution.
The idea is to break this instruction from the following way, the first group is mysql_query
the second $query
and the third $db
. With the captured elements, reverse the order of the second with the third and add the parentheses.
The first one takes the instruction: (mysql_query)
the second the variable with the query ( \$\w+
), which is represented by a dollar sign followed by one or more letters followed by a comma and one more variable. p>
Search for:
(mysql_query)\((\$\w+)\s*,\s*(\$\w+)\)
Replace with:
\(,\)
Or:
$1\($3,$2\)