Changes

Jump to navigation Jump to search
52 bytes removed ,  15:04, June 23, 2016
m
clean up
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]].
 
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,
+
To match any of 2 or more characters, enclose them in square brackets. For example,  
<br /><br /> gr[ae]y
+
 
<br /><br />
+
gr[ae]y
 +
 
 +
 
 
will match ''gray'' or ''grey''.
 
will match ''gray'' or ''grey''.
   Line 25: Line 27:     
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.
<references/>
+
 
 
== Examples ==
 
== Examples ==
   Line 36: Line 38:  
A '''regular expression''' is particular instance of a non-[[deterministic]] [[finite]] state [[automaton]].  Regular expressions are a [[type-3 grammar]] in the [[Chomsky hierarchy]] of [[language]].
 
A '''regular expression''' is particular instance of a non-[[deterministic]] [[finite]] state [[automaton]].  Regular expressions are a [[type-3 grammar]] in the [[Chomsky hierarchy]] of [[language]].
   −
A regular expression is not able to count.  This is because there is a finite number of states.  Consider the language that is specified by a<sup><small>n</small></sup>ba<sup><small>n</small></sup>.  Examples of this language include b, aba, aabaa, aaabaaa, etc... A regular expression - being a [[finite state automaton]] itself - has a finite number of states that it can be in.  If there a point at which the state loops back on itself it is no longer able to match that language.
+
A regular expression is not able to count.  This is because there is a finite number of states.  Consider the language that is specified by a<sup>n</sup>ba<sup>n</sup>.  Examples of this language include b, aba, aabaa, aaabaaa, etc... A regular expression - being a [[finite state automaton]] itself - has a finite number of states that it can be in.  If there a point at which the state loops back on itself it is no longer able to match that language.
    
== See also ==
 
== See also ==
Line 45: Line 47:  
== Further reading ==
 
== Further reading ==
 
* http://www.regular-expressions.info/reference.html
 
* http://www.regular-expressions.info/reference.html
 +
<references/>
 
[[Category:Computer Science]]
 
[[Category:Computer Science]]
[[Category:language]]
+
[[Category:Language]]
Block, SkipCaptcha, Automoderated users, Bots, edit
57,719

edits

Navigation menu