The dot matches one character
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
The whole line must match. Match three-character lines that start with h and end with t, with any single character in the middle.
What this exercise teaches
h.t matches h, then exactly one character of any kind, then t. Because the whole line must match, longer lines fail.
A hint if you get stuck
The dot stands for any one character except a line break.
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 exercise