www.delorie.com/gnu/docs/regex/regex_2.html   search  
Buy the book!


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Regular Expression Syntax

Characters are things you can type. Operators are things in a regular expression that match one or more characters. You compose regular expressions from operators, which in turn you specify using one or more characters.

Most characters represent what we call the match-self operator, i.e., they match themselves; we call these characters ordinary. Other characters represent either all or parts of fancier operators; e.g., `.' represents what we call the match-any-character operator (which, no surprise, matches (almost) any character); we call these characters special. Two different things determine what characters represent what operators:

  1. the regular expression syntax your program has told the Regex library to recognize, and

  2. the context of the character in the regular expression.

In the following sections, we describe these things in more detail.

2.1 Syntax Bits  
2.2 Predefined Syntaxes  
2.3 Collating Elements vs. Characters  
2.4 The Backslash Character  

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003