Regular Expression | Set |
---|---|
a | { a } |
b | { b } |
ab -- sequence | { ab } |
c | d -- choice | { c, d } |
a (b | c) | { ab, ac } |
a5 -- repetition | { aaaaa } |
a* | { ε, a, aa, aaa, aaaa, aaaaa, ... } |
More examples:
cd web/3800/notes egrep '(S|s)(Y|y)(N|n)(T|t)(A|a)(X|x)' *.htmlor at the Windows Command prompt (with GOW installed):
c: cd web\3800\notes egrep "(S|s)(Y|y)(N|n)(T|t)(A|a)(X|x)" *.htmlMatches Syntax, SYNTAX, sYntax, etc.
(+|-|ε)(0|1)(0|1)*
if input != a error advance if input != b error advance
while input == a advance
if input == a or input == b advance else error
while input == 0 advance if input != 1 error advance while input == 0 or input == 1 advance
egrep \[[0-9a-zA-Z_]*\] *.cpp
[^0-9]
[^0-9A-Za-z_]