Didn't read all, just till:
const reMatchThree = /(?:\s|^)(three)(?:\s||.|,|;|:|'|"|!|"|'|$)/g
Why don't you simply use:
const reMatchThree = /\b(three)\b/g
?
I completely forgot about word boundaries while I was writing it late at night lol. I’ve updated the article. Thanks for this. 😎
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Didn't read all, just till:
Why don't you simply use:
const reMatchThree = /\b(three)\b/g
?
I completely forgot about word boundaries while I was writing it late at night lol. I’ve updated the article. Thanks for this. 😎