Compare substring and whole-line counts

A file named values.txt contains seven lines with no surrounding spaces:


Plain text
4
27
105
id=38
62 74
00
done


Using the C locale, determine the selected-line counts printed by grep -Ec '[0-9]{2}' values.txt and grep -Exc '[0-9]{2}' values.txt. Enter each count in lines as an exact integer, with 0 decimal places.

Your answers

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: