[英]how to replace multiple occurrences of ` and <br>`
how to replace multiple occurrences of and <br>
如何替换多次出现的
and <br>
and <br>
at start of the string with javascript regex? and <br>
在使用javascript正则表达式的字符串开头?
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". ...,其中
/
... /
表示正则表达式, ^
表示字符串的开头, ($nbsp;|<br>)
表示“
或 <br>
,而+
表示“前一个或多个出现表达”。 And then simply replace that full match with an empty string. 然后只需用空字符串替换完全匹配项即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.