I am just starting to learn js and I got stuck to regexp at a specific expression. Can you figure out what !![a-z]* will match ?
I can't seem to figure this one out.
-
This is not JavaScript specific.Felix Kling– Felix Kling2011-06-19 17:38:01 +00:00Commented Jun 19, 2011 at 17:38
Add a comment
|
3 Answers
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.
Comments
'!!abcdefgh$asd124123'.match(/!![a-z]*/g)
return ["!!abcdefgh"]
'!!#abcdefgh$asd124123'.match(/!![a-z]*/g)
return ['!!']
1 Comment
RBT
From review queue: May I request you to please add some context around your source-code. Code-only answers are difficult to understand. It will help the asker and future readers both if you can add more information in your post.