re - regular expression notes

.    match a single char
^ match the beginning of a line
$ match the end of a line
*    Match zero or more
[    start a match list
\    escape any of the above
 

a* match zero or more a s
[ab]    match an a or b, other handy items a-z, A-Z, 0-9
\x0D    Match a cntrl/control character like ^M
[^ab]    Don't match an a or b
[-a-z]    match hypen and a thru z, [a-z-] works too
[]a-z]    match [ and a-z
[ab\*]    match a, b or *
\(RE\)    subexpresion (saved for use via \# where # is a number)

Extended option

+    one or more (* is zero or more)
?    zero or one
|    or
()    groupsing
\{min,max\}    control number of matches

re is greedy!

precedence

[]    highest
*+?
^$
concatenation
alternation

Allen notes from the  Saint Louis Unix Users Group  meeting Apr 8th 2002