in reply to Exact pattern match inside index()

You are matching for \bCAT\b with a regular expression. From perldoc perlre:
A word boundary ("\b") is a spot between two characters that has a "\w" on one side of it and a "\W" on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a "\W". (Within character classes "\b" represents backspace rather than a word boundary, just as it normally does in any double‐quoted string.)

\w Match a "word" character (alphanumeric plus "_")
\W Match a non-"word" character