Count lines rather than occurrences

The file alerts.txt contains the following six lines, shown in order:


Plain text
error error
err
terror
ERROR
warning
erratic


A student runs the case-sensitive command grep -Ec 'err(or)?' alerts.txt. What number does it print? Give the number of selected lines as an exact integer, with 0 decimal places.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Regular Expressions and Wild Cards Questions: