Build your own grep

Write the pattern matcher behind every search box, from scratch.

grep has searched text on Unix since 1973. The same ideas power Ctrl+F, log search, form validation and code editors’ find-and-replace.

About 150 minutes across 7 stages. Skills: Regular expressions, Backtracking, Recursion, Tokenizing.

The guides are part of licode Club.

Stages

  1. Print lines that contain a plain-text pattern.
  2. Support \d and \w.
  3. Support [abc] and [^abc].
  4. Support ^ and $.
  5. Support + and ?.
  6. Support the wildcard ..
  7. Support (a|b) alternation.