I got a page with prime-faces editor component to create document models, so that the model is saved in DB and used as template to create new documents easier in the future.

The problem is that the older models saved by a legacy system are not being properly formatted in the editor, to be more specific, it is ignoring left blank spaces.

I found out that if I replace spaces `" "` by `"&nbsp"` the editor shows the spaces, but I just can't get the right regex working on it.

What I need to do is: get all spaces major than `" "` (e.g. `" "` or `" "`) and replace it by the right `"&nbsp"` number. So that `" "` would be replaced by `"&nbsp&nbsp"`.

Using the following regex I can reach the conditional of more than 1 space, but I don't know how to replace it.

```
 myString.replaceAll(" [\\s]+", "????");

```

Is that possible to do? Or I'd better think on something else?