The main confusion in class today (on my part, and therefore probably on yours...) relates to the way the following three "meta-characters" are handled:
Below is a table containing a bunch of examples. The color key to the table is:
Here is the table of examples:
|matches lines that contain a consecutive AE|
|matches lines that contain an A followed by one of any character followed by an E|
matches lines that contain 0 or more A's followed by an E|
Note that "ABE" and "ABBE" match for the same reason that "BE", "BEE" and "BBEE" match.
The important thing is the E -- in these cases, the A doesn't matter.
The match occurs because we have 0 A's preceding the E.
matches lines that contain 0 or more E's after an A
As above, the reason that "ABE" and "ABBE" match is because of the A.
These words match with an A immediately followed by 0 E's.
|matches lines that contain an A followed by a single character followed by 0 or more E's|
matches lines that contain 0 or more A's followed by a single character followed by an E
Note that "AE" matches for the same reason that "BE" matches.
"BE" contains 0 A's before the E -- B is the single character.
In "AE", the A is counted as the single character and there are 0 A's before it.
|matches lines containing an A followed by a single character followed by 0 or more E's|
|matches lines containing 0 or more A's followed by an E followed by a single character|
|matches lines containing one or more A's followed by an E|
|matches lines containing an A followed by one or more E's|
|matches lines containing an A followed one or more of a single character followed by an E|