Please see this


Contents

- INDEX
- Unix Scripts Index
- Solaris
- Linux Index
- Other Unix types
- General Unix
- Unix Networking
- HP-UX
- Unix databases

Associated Information

- none

Useful Links

- GAWK Manual
- Sed resources

Regular Expressions - Meta Character Summary

Basic Metacharacters

  • . any single character except newline

  • * any number (including zero) of the single character that immediately preceeds it

  • [...] matches any one of the characters (known as a class) enclosed in the brackets.
    If the first character in the brackets is a ^ i.e. [^...] , this reverse the match, i.e. anything but the characters in the brackets
    A - specifies a range e.g. [a-z]

  • ^ As the first character of a regular expression matches the start of a line

  • \{n,m}\ matches a range of occurrences of the single character that preceeds it e.g. a\{4\} matches four a`s , a\{4,\} matches at lease 4 a`s , a\{4,8\} matches between 4 to 8 a`s.

  • \ Escape special meaning

Extended Metacharacters

  • + matches one or more occurrences of character (or regular expression)

  • ? matches zero or one occurrences of character (or regular expression)

  • | matches either/or (alternation)

  • () groups regular expressions e.g. (abc)* matches " " , "abc " , "abcabc" etc.

  • {n,m} matches a range of occurrences of the single character that immediately precceds it

Copyright 2000 Intronet Computers Ltd
Email: Intronet Computers for enquiries