OID Repository
OID Repository
http://www.oid-info.com
Display OID:
 
Regular expressions
Introduction Syntax
   
 
tiret
Introduction
 

POSIX 1003.2 regular expressions provide a powerful means for pattern matching. Many Unix tools such as egrep, sed, or awk use a pattern matching language that is similar to the one described here.

A regular expression is a character sequence that is an abbreviated definition of a set of strings. A string is said to match a regular expression if it is a member of the set described by the regular expression. A regular expression is allowed to match anywhere within a string, unless the regular expression is explicitly anchored to the beginning or end of the string (by use of operators ^ and/or $).

 
 
tiret
Syntax
 

The following character sequences are recognized:

  • . matches any single character except newline
  • \. matches the dot "." character
  • * (postfix) matches the previous expression zero, one or several times
  • + (postfix) matches the previous expression one or several times
  • ? (postfix) matches the previous expression once or not at all
  • [  ] character set; ranges are denoted with a hyphen "-", as in [a-z]; an initial caret "^", as in [^0-9], complements the set
  • ^ matches at beginning of line
  • $ matches at end of line
  • | (infix) alternative between two expressions
  • (  ) grouping of the enclosed expression
  • \ quotes special characters (i.e., ^.[$()|*+?{\)
  Complete syntax
[mailto:admin@oid-info.com] Webmaster