For a project of mine, I am parsing reddit comments and trying to make them uppercase. It works perfectly well with plain text, however with things such as links it creates bugs, making the characters in the link uppercase and therefore making the link unusable. Now links on reddit have very simple syntax, namely `[text](url)`. I would like to output `[TEXT](url)` knowing my comment will most probably have some other content.

I tried using regexes, but this doesn't work while I still think I'm pretty close :

```
import re

def make_upper(comment):
    return re.sub(r"\[([^ ]*)\]\(([^ ]*)\)", r"[\1]".upper() + r"(\2)", comment)

```

That regex is a bit messy (like all regexes ;) but still readable to me and I wouldn't mind explaining it if need be.

Input:

```
"blablabla (btw, blargh!) [text](url) blabla"

```

Desired output:

```
"BLABLABLA (BTW, BLARGH!) [TEXT](url) BLABLA"

```