how to replace multiple occurrences of ` and <br>`
how to replace multiple occurrences of and <br>
at start of the string with j开发者_如何转开发avascript regex?
myString = myString.replace(/^( |<br>)+/, '');
... where /
.../
denotes a regular expression, ^
denotes start of string, ($nbsp;|<br>)
denotes "
or <br>
", and +
denotes "one or more occurrence of the previous expression". And then simply replace that full match with an empty string.
精彩评论