I'm trying to find all words with 3 letters in a string.
So in this list
cat monkey dog mouse
I only want
cat dog
This is my expression:
^[a-zA-Z]{3}$
I tested it with different online regex tester, but none of them matched my expression.
You should use your match with word boundaries instead of anchors:
\b[a-zA-Z]{3}\b
RegEx Demo
When you use:
^[a-zA-Z]{3}$
It means you want to match a line with exact 3 letters.
you can use .
instead of [a-zA-Z]
if you want to match any character (also numbers):
\b.{3}\b