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 ['!!']
精彩评论