regex for uppercase

I have an issue similar to the one described here [url]https://forum.literatureandlatte.com/t/how-to-shift-marked-phrases-to-uppercase-during-compile/25658/2], but a different use case, so the solution described there won’t work for me.
Upon compile I am trying to run the following regex:
{(\w+)} \U$1 which is supposed to return all words in {Braces} as uppercase, i.e., for {Test} I would like to get TEST.
I tried the above, \U\1 and \U1 but none of them does the uppercase. (Getting rid of the braces works fine.)
\U$1 gives me UTest, the others give me simply U1.
Anyone can help me with the correct syntax?
Thanks a lot!

Edit: Should I report this as a bug on the other forum? It seems that my syntax is correct at least in standard regex terms.

In spite of what online regex references state, the \w+ part doesn’t seem to work in this context. Also, you shouldn’t have to escape the curly brackets, but you probably do need to escape the parentheses. Finally, your regex doesn’t seem capable of removing the curly braces.

I experimented with the regex engine in the “sed” command, and found that this works to capitalize the word in {}s:
({\w*})
replacing it with
\U\1

When I play with that on the command line, feeding it the string “Things, {stuff}, and bits & bobs.”, it comes out “Things, {STUFF}, and bits & bobs.”

So that gets you most of the way there. You could use a more complex regular expression to strip out the {}s, but you could also add another line to the replacements compile pane (or just use the search tool) to replace “[{}]” (which translates as any instance of either curly brace in regex) with nothing.

But if you enjoy complexity, the more complex regex is:
({)(\w*)(})
replaced with
\U\2

If we didn’t have to escape the parentheses, it would look a little more comprehensible; “({)(\w*)(})” Without the extra visual noise, it shows that we first match the opening curly brace, then the word within, and then the closing brace, storing them up in the variables \1 \2 and \3. By not including \1 or \3, we effectively throw them out of the end result.

I hope that works in Scrivener; I haven’t got my Mac at hand to give it a try. Good luck!

Thank you @rdale for looking into this.
Unfortunately, your suggestions don’t work in Scrivener.
I’ve updated my question above, since I wasn’t being very precise. Getting rid of the braces was working fine, but it seems that Scrivener does not understand the \U modifier. My question is essentially if there is a different way to achieve this in Scrivener. I don’t know a lot about different regex conventions but from what I found on the internet it seems that sed, perl, etc. all have slightly different implementations, so I was wondering what conventions the Scrivener regex options follow, and how (if at all) I can modify the case of the output. But I appreciate your help.

Sorry I misinterpreted your issue. I tried to effect the outcome you want in various online regex test sites, and had mixed results with the uppercase function. I found that this pattern worked:
{(\w+)}

but whether \U\1 or any variation on that would produce a capitalized value from within the {}s was dependent on the on the site. Might as well post in the Bug Hunt forum in case there’s something that Keith can do about it.

Online sites I’ve tried (couldn’t find an online COCOA or SWIFT regex test site):
regexpal.com/
rubular.com/
regex101.com/r/tylTyS/1