You can envy the arguments by creating three groups at the end just format the substitution.
The idea is to break this instruction of the following form, 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 parentheses.
The first takes the instruction: (mysql_query)
the second variable with the query (\$\w+
), representing a dollar sign followed by one or more letters, followed by a comma and a variable.
Look for:
(mysql_query)\((\$\w+)\s*,\s*(\$\w+)\)
Replace with:
\1\(\3,\2\)
Or else:
$1\($3,$2\)
Thank you very much.
– Rodrigo Luan