A word boundary is a position between a word character and a non-word character. In a regular expression, \b lets a search match a prefix only when that prefix begins a word, rather than matching inside another word. section 15.4
Fixing a multiword search
To support case-insensitive prefix searches, lowercase both strings and build a regular expression from the prefix: new RegExp("\\b" + prefixLowerCase). Thus, \bHabits and \b7 Habits match “7 Habits of Highly Effective People,” while abits does not; \bHabits of also matches. section 15.4


