I have a string kind of:

```
String text = "(plum) some other words, [apple], another words {pear}.";

```

I have to find and replace the words in brackets, don't replacing the brackets themselves.

If I write:

```
text = text.replaceAll("(\\(|\\[|\\{).*?(\\)|\\]|\\})", "fruit");

```

I get:

```
fruit some other words, fruit, another words fruit.

```

So the brackets went away with the fruits, but I need to keep them.

---

Desired output:

```
(fruit) some other words, [fruit], another words {fruit}.

```