First of all, you use search-forward in your first function. This takes a string literal, not a regular expression. You should use search-forward-regexp , as in the second function.
Secondly, although this code is valid as a replacement value for query-replace-regexp , I don't think you can pass it to replace-match :
(\\,(upcase \\1))
You can get the match value found with search-forward-regexp using the match-string function.
Finally, I'm not sure if your regular expression search is correct.
I think you need something like that:
(defun upcs () (interactive) (goto-char 1) (while (search-forward-regexp "(\\([^\\)]+\\))" nil t) (replace-match (upcase (match-string 1)) t nil)))
source share