Shark Deng

Interactive Designer @Shanju Design in Shanghai

touched caffe / mxnet / python / wordpress / bootstrap / Arduino / Raspberry Pi / webgl / three.js / PIXI / 3dMax

Email

Github

正则表达式- + / .+ / .+?

2019-11-20 16:47:30

+

var a = "abcABC".match(/[a-zA-Z]/);
var b = "abcABC".match(/[a-zA-Z]+/);
alert(a); //
alert(b); //abcABC

.+  / .+?

var r2 = "<span></span>".match(/<.+?>/)
var r3 = "<span></span>".match(/<.+>/)
alert(r2); //<span>
alert(r3); //<span></span>

 



——By SharkDeng
如果你喜欢我的文章,欢迎红包赞赏

Leave a Reply

Your email address will not be published. Required fields are marked *