I have a string, let's say:
var str = " "
To replace this with an empty string I'm using this regex:
str.replace(/^( |<br>)+/, '');
This is removing only the first nbsp;. The remaining two are still there. Can anyone please help me to remove all the occurrences of nbsp; and <br> from the string?
goption in your regex.^means start of the sentence. So of course only the first one is removed...