Let’s say I want to highlight the word “the” in the sentence: They went to the mall.
I would use the RegExp:
var find_the = /the/g;
However when I use this it highlights both the (‘the’ in they) and the word ‘the’. So how would I form a RegExp that would only find the word “the” and not the letters in order “the”?
var articles = /the\b|a\b|an\b/g;
var prepositions = /at\b|by\b|during\b|for\b|from\b|of\b|through\b|to\b|with\b/g;
var personal_pronouns = /I\b|we\b|me\b|us\b|you\b|he\b|they\b|him\b|them\b|she\b|her\b|it\b/g;