Regular Expressions

A way of describing strings using a variety of wild-card symbols.

Possible identifiers :
  beginning of line.
  end of line.
  beginning of word.
  end of word.
  character lists
  repeating characters
  repeating phrases.
  character wild-cards.

Used by :


Regular expression pattern
Simplest match - literal string.
  Search for lines with string bin in them.

ps -ef | grep 'bin' | less

  Any 3 character sequence of 'bin' results in a match.

Because regex uses same meta-characters as file wildcards, quote pattern
to avoid interpretation by command parser.

If using the dollar sign, consider using single quotes.

Line anchors
Word anchors. A word consists of a sequence of alpha-numeric and/or underscore _ characters. A character different than these indicates the beginning or end of a word.
Character matches.
Operators The regular expression library contains an additional set of symbols that act as operators to further modify the expression.
See : man -s 7 regex

Also : Sed & Awk
       by Dale Dougherty
       O'Reilly & Associates, Inc.