REGULAR EXPRESSIONS

  • Regular expressions are a form of pattern matching syntax which many commands use. (e.g. grep, sed)
  • They are very flexible and not quickly learnt.
  • Some basic forms are easy to learn and very useful.
  • Not the same as shell wildmasks, although some are similar.
  • Special characters used in regular expressions include:
    . matches any one character
    * matches zero or more of the last character
    .* matches any string
    [ ] matches any character in the range
    ^ represents the start of the line
    $ represents the end of the line
    [^ ]   matches any character not in the range