I need to do that with Jquery + Regular Expression:

For instance:

```
HELLO WORLD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HELLO WORLD2&nbsp;&nbsp;HELLO WORLD3&nbsp;

```

final result

```
HELLO WORLD<span class='test'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
HELLO WORLD2<span class='test'>&nbsp;&nbsp;</span>
HELLO WORLD3<span class='test'>&nbsp;</span>

```

I have two doubts:

1.- If the number of no-break spaces is always random, exist a way for wrap this groups with regular expressions?

2.- Only with Jquery or javascript is possible insert in the inital and final position of this group?