I didn't find a solution inside **regex's** documentation for my current problem. I'm using javascript, html.
My code is like this:

```
var text = 'This [close](animal) is a dog';

```

I want to get this using **regex**:

```
'This {animal} is a dog';

```

what I mean, i want to have **'close'** replaced with **{** and **}**.
I know, there's a solution like:

```
var res = text.replace('[close](','{').replace(')','}');

```

but in my case, I have many rules and I don't want to duplicate that line to do so. Sometimes I'm using other replacement like **'[ xxxxx ]'**.
Any idea? Thank you!