I am trying to replace this:mysqli_query($query_tpl2,$linkid_log);with:mysqli_query($linkid_log,$query_tpl2);where query can be anything (any word, that is).I have this seemingly working reg ex:(mysqli_query\()\s*(\$\w+.*)\s*,.*(\s*\$linkid_log\s*)\)So I built my Sed this way:sed -ri 's/(mysqli_query\()\s*(\$\w+.*)\s*,.*(\s*\$linkid_log\s*)\)/mysqli_query(\3,\2)/g' orderdetail.phpand it works!! Problem is when I try a recursive form (all files within a directory and subdirectories) I went with:find -type f | xargs sed -i  's/(mysqli_query\()\s*(\$\w+.*)\s*,.*(\s*\$linkid_log\s*)\)/mysqli_query(\3,\2)/g'it throws a sed: -e expression #1, char 80: invalid reference \3 on `s' command's RHSwhich doesn't seem to be working. Ideas? I've trying everything I can remember but I'm not exactly an expert.
Replacement of strings using regex with sed
sed;find;regular expression;command;replace