diff --git a/9-regular-expressions/16-regexp-sticky/article.md b/9-regular-expressions/16-regexp-sticky/article.md index 161ce4dd..373f3453 100644 --- a/9-regular-expressions/16-regexp-sticky/article.md +++ b/9-regular-expressions/16-regexp-sticky/article.md @@ -13,7 +13,7 @@ E.g. we have a code string `subject:let varName = "value"`, and we need to read We'll look for variable name using regexp `pattern:\w+`. Actually, JavaScript variable names need a bit more complex regexp for accurate matching, but here it doesn't matter. -- A call to `str.match(/\w+/)` will find only the first word in the line (`var`). That's not it. +- A call to `str.match(/\w+/)` will find only the first word in the line (`let`). That's not it. - We can add the flag `pattern:g`. But then the call `str.match(/\w+/g)` will look for all words in the text, while we need one word at position `4`. Again, not what we need. **So, how to search for a regexp exactly at the given position?**