To test the basic functioning of the asterisk metacharacter in search operations using grep, I used a file (regex.txt) with the following contents:
$ cat regex.txt
1
11
111
1111
11111
$
There are 6 newlines after the 11111 in my example, intentionally added.
Question 1.
Why does the output of grep "11*" regex.txt not include the newlines after 11111 unlike the output of grep "1*" regex.txt?
Question 2.
The output of grep "111*" regex.txt is
11
111
1111
11111
The output of grep "1111*" regex.txt is
111
1111
11111
The output of grep "11111*" regex.txt is
1111
11111
Why are the top layers missing for every increase in '1' in the search key?