开发者

Js regexp question match

I am just starting to learn js and I got stuck to regexp a开发者_如何学Ct a specific expression. Can you figure out what !![a-z]* will match ? I can't seem to figure this one out.


You should really consider reading how regular expressions work. Have a look at http://www.regular-expressions.info/tutorial.html.

That would match 2 exclamation marks (!) followed any number of letters from a to z.


Two exclamation marks followed by any number (including 0) of characters from a to z.


'!!abcdefgh$asd124123'.match(/!![a-z]*/g)
return ["!!abcdefgh"]

'!!#abcdefgh$asd124123'.match(/!![a-z]*/g)

return ['!!']
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜