在'*, +, ?, {}'这三个量词后面添加'?'开启非贪婪模式,在匹配html标签时非常有用 比如 '<p><span>test</span><br>second</p>'.replace(/<.+?>/g, ' ') 输出为 test second
Posted in: WEB practise
Comments are closed.
国外VPS推荐
Comments are closed.