I do not understand how to limit the capture group.
If I have a regex:
/^(\w{2,}\s\w{2,}){4,15}$/
I would think that this would capture any string with:
- Exact two words,
- For each word less than 2 characters long
- And a whole line of no more than 15 characters.
But limiting my captured groups doesn't work. Can I limit capture groups at all?
PS. I use JavaScript to check for regular expressions in my examples.
source share