Find a literal word
A regex exercise from Regexdrill. Solve it with a pattern box with live highlighting in your browser, checked against hidden test strings, and it is checked the moment you submit.
The task
Match every line that contains the lowercase text cat anywhere. A match anywhere on the line counts.
What this exercise teaches
A plain run of letters matches that exact text wherever it appears, including inside longer words like concatenate.
A hint if you get stuck
Letters and digits match themselves. Matching is case sensitive by default.
Try it now, no account needed
This exercise is free. Open it on the practice page, solve it, and get instant feedback with a hint and a worked solution after two tries.
Open this exerciseMore exercises in Basics
- The dot matches one characterFree
- Character class: gray or greyFree
- Ranges: a letter and two digitsFree
- Negated class: no vowelsFree
- Counted repeats: 3 to 5 digitsPro
- One or more: goal, gooal, goooalPro
- Optional letter: color or colourPro
- Anchors: lines that start with ERRORPro
- Escaping: a price like $4.99Pro