BASICS

Case sensitivity

Patterns match case exactly unless you add the i flag.

By default error does not match "Error". Case matters, character by character.

Most engines let you attach flags that change how the whole pattern behaves. The i flag means ignore case, so error then matches error, Error, and ERROR. From this lesson on you have a flags input next to the pattern.

i ignore case for the whole pattern
g global - find all matches, not just the first (always on here)

There are more flags, each covered later: m (multiline anchors), s (dotAll), u/v (unicode), y (sticky). Full list: MDN: flags.

PRACTICE - 2 DRILLS 0/2 DONE
DRILL 1/2

Match every form of the word error, regardless of case.

/ /
Error: file not found
must match: "Error"
the error was logged twice
must match: "error"
ERROR ERROR
must match: "ERROR" "ERROR"
no problems here
must match nothing
DRILL 2/2

Match the word TODO only when it is written in uppercase. Leave other casings alone.

/ /
TODO: fix this. todo later, Todo now
must match: "TODO"
nothing to do
must match nothing
todo todo Todo
must match nothing