CITIDEL >
Planet Math Computer Science >
Planet Math Computer Science Collection >
Please use this identifier to cite or link to this item:
http://hdl.handle.net/10117/1284

Title:  regular expression 
Issue Date:  3Apr2004 
Publisher:  PlanetMath 
Citation:  http://planetmath.org/encyclopedia/RegularExpression.html 
Abstract:  A ... regular expression is a particular metasyntax for specifying regular grammars, which has many useful applications. While variations abound, fundamentally a regular expression consists of the following components. Parentheses can be used for grouping and nesting, and must contain a fullyformed regular expression. The ... == symbol can be used for denoting alternatives. Some specifications do not provide nesting or alternatives. There are also a number of postfix operators. The ... =?= operator means that the preceding element can either be present or nonpresent, and corresponds to a rule of the form ... . The ... =*= operator means that the preceding element can be present zero or more times, and corresponds to a rule of the form ... . The ... =+= operator means that the preceding element can be present one or more times, and corresponds to a rule of the form ... . Note that while these rules are not immediately in regular form, they can be transformed so that they are. Here is an example of a regular expression that specifies a grammar that generates the binary representation of all multiples of 3 (and only multiples of 3). ... This specifies the contextfree grammar (in BNF): ... A little further work is required to transform this grammar into an acceptable form for regular grammars, but it can be shown that this grammar (and any grammar specified by a regular expression) is equivalent to some regular grammar. One can understand the language described by a regular expression in another way, by viewing the regular expression operators as shorthand for various settheoretic operations. For example, suppose we have a regular expression describing a set of words on some alphabet Sigma. Then: ... A single character 
URI:  http://www.citidel.org/handle/10117/1284 
Appears in Collections:  Planet Math Computer Science Collection

Files in This Item:
File 
Size  Format 
RegularExpression.html  35Kb  HTML  View/Open 

All items in DSpace are protected by copyright, with all rights reserved.
