Regexdrill

Level 1: Basics Exercise 9 of 52 Pro

Anchors: lines that start with ERROR

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

A match anywhere counts, so anchor the pattern yourself. Match lines that begin with the word ERROR in capitals.

What this exercise teaches

^ERROR only matches when ERROR is the very first text on the line. Without the caret, ERROR in the middle of a line would count too.

A hint if you get stuck

The caret ^ outside brackets means the start of the line. The dollar sign $ means the end.

This exercise is part of Pro

Pro unlocks all 52 exercises, with worked solutions and progress saved to your account. The free exercises work without an account.

You create a free account first, so Pro is attached to it.

Monthly is charged today and then every month until you cancel, in one click from your account page. Lifetime is one payment with no renewals. Full refund within 14 days of paying.

Start with the free exercises

More exercises in Basics