Changes

Jump to navigation Jump to search
178 bytes added ,  22:50, February 8, 2010
trying to make this article less lame
Line 1: Line 1:  
A '''regular expression''' is used in computer software to define a sequence of characters.<ref>"A regular expression, or regex for short, is a pattern describing a certain amount of text." [http://www.regular-expressions.info/quickstart.html Regular Expression Quick Start] </ref>
 
A '''regular expression''' is used in computer software to define a sequence of characters.<ref>"A regular expression, or regex for short, is a pattern describing a certain amount of text." [http://www.regular-expressions.info/quickstart.html Regular Expression Quick Start] </ref>
 +
 +
In general, any character will match itself, but there are a dozen special characters, including the [[escape character]].
 +
 +
To match any of 2 or more characters, enclose them in square brackets. For example,
 +
 +
gr[ae]y
 +
 +
will match ''gray'' or ''grey''.
    
A regular expression is matched from left to right and is processed one [[token]] at a time.  Certain characters have special meanings within the description of a regular language:
 
A regular expression is matched from left to right and is processed one [[token]] at a time.  Certain characters have special meanings within the description of a regular language:
Line 15: Line 23:  
* '\\' - a literal backslash
 
* '\\' - a literal backslash
 
* '\.' - a literal period
 
* '\.' - a literal period
* '\s' - any whitespace character
+
 
* '\b' - a word boundary
  −
* '\d' - a digit
      
Regular expressions have also been extended by many languages, some of which extend them to the point where they are able to match a wider range of languages than is specified by a regular language.
 
Regular expressions have also been extended by many languages, some of which extend them to the point where they are able to match a wider range of languages than is specified by a regular language.
Siteadmin, Check users, nsTeam1RO, nsTeam1RW, nsTeam1_talkRO, nsTeam1_talkRW, oversight, Administrators
30,650

edits

Navigation menu