javascript - How to use regular expressions to remove the * sign in front of '****abc*vkf****'
PHPz
PHPz 2017-05-19 10:27:04
0
4
708

abcvkf Only delete the front * sign, and keep the middle and back ones. How should the regular expressions be matched?

PHPz
PHPz

学习是最好的投资!

reply all(4)
曾经蜡笔没有小新


Okay, it is always transcoded. Look at the picture. As long as the replace is not global, it will be fine.

'****abc*vkf****'.replace(/[\*]+/, '')
我想大声告诉你

Is this so? Use zero-width assertion http://www.cnblogs.com/deerch...

var s = '****abc*vkf****',
    res = s.replace(/\**(?=abc)/g,'');
伊谢尔伦

var str="abcvkf*";

var rex=/^*+/ig;

str.replace(rex,"")

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template