The . means “any character,” and the * means “zero or more of the preceding thing,” in this case “zero or more of any character.” So .* matches pretty much any text at all. egrep only matches on a line-by-line basis, so freedom and GNU have to be on the same line.
Here’s a summary of regular expression metacharacters:
. Matches any single character except newline.
* Matches zero or more occurrences of the preceding thing. So the expression a* matches zero or more lowercase a, and .* matches zero or more characters.
[characters] The brackets must contain one or more characters; the whole bracketed expression matches exactly one character out of the set. So [abc]matches one a, one b, or one c; it does not match zero characters, and it does not match a character other than these three.
^ Anchors your search at the beginning of the line. The expression ^The matches The when it appears at the beginning of a line; there can’t be spaces or other text before The. If you want to allow spaces, you can permit 0 or more space characters like this: ^ *The.
$ Anchors at the end of the line. end$ requires the text end to be at the end of the line, with no intervening spaces or text.
[^characters] This reverses the sense of a bracketed character list. So [^abc] matches any single character, except a, b, or c.
[character-character] You can include ranges in a bracketed character list. To match any lowercase letter, use [a-z]. You can have more than one range; so to match the first three or last three letters of the alphabet, try [a-cx-z]. To get any letter, any case, try [a-zA-Z]. You can mix ranges with single characters and with the ^metacharacter; for example, [^a-zBZ]means “anything except a lowercase letter, capital B, or capital Z.”
() You can use parentheses to group parts of the regular expression, just as you do in a mathematical expression.