Basics Regular Expression
1) The $ and ^
^XXX matches the beginning of a line
XXX$ matches the end of a line
2) match any character with .
3) specify a range of characters with [...]
4) repeating character sets with *
5) matching a specific number of sets with \{ and \}
6) matching words with \< and \>
7) remembering patterns with \(..\) and \1
8) OR: \|
Extended Regular Expression
POSIX character sets
Python extension
Perl extension
Reference
http://www.grymoire.com/Unix/Regular.html
(regular expression)
http://www.grymoire.com/Unix/Sed.html
(sed)
Potential Problems
1. Each utility may has its own convention for regular expressions, for example, vi, python, perl, sed, to name a few.
2. Basic regular expressions match the longest possible pattern, so be careful when using it with sed.