JS: 'catfish is not a cat'.match(/\bcat\b/g)
Py: re.findall(r'\bcat\b', 'catfish is not a cat')
output
["cat"] (matches only the standalone word, not "catfish")
Note A word boundary is the position between a word character (\w) and a non-word character. Essential for whole-word searches. In JS, remember to double-escape in strings: new RegExp('\\bcat\\b').