OID Repository
OID Repository
Display OID:
Regular expressions
Introduction Syntax
separation line

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 using operators ^ and/or $).

separation line

The following character sequences are recognized:

  • . matches any single character except newline
  • * (postfix) matches the previous expression zero, one or several times
  • + (postfix) matches the previous expression one or several times
    • [+] matches a "+" character (escape mechanism)
  • ? (postfix) matches the previous expression once or not at all
  • [  ] is a 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
    • [(] matches a "(" character and [)] matches a ")" character (escape mechanism)
  • \ escapes special characters (i.e., ^.[$|*?{'):
    • \n matches a newline character
    • \. matches a dot "." character
    • \' matches a quote "'" character
    • \ cannot be escaped; to search for a backslash, use . to match any single character
OID helper Webmaster