Regular expression examples: Difference between revisions

Content deleted Content added
m space
m categ
Line 1:
A [[regular expression]] ( also "RegexRegEx" or "regex" ) is a string that is used to describe or match a set of strings, according to certain [[syntax]] rules. The specific syntax rules vary depending on the the specific [[implementation]], [[programming language]], or [[Library (computing)|library]] in use. Additionally, the functionality of regex implementations can vary between [[Software versioning|version]]s.
 
Despite this variability, and because regular expressions can be difficult to both explain and understand without examples, this article provides a basic description of some of the properties of regular expressions by way of illustration.
 
== Examples ==
 
Here are some examples of [[Perl]] [[regular expression]]s.
Unless otherwise indicated, the following examples conform to the [[Perl]] programming language, release 5.8.8, [[January 31]] [[2006]]. The examples may also be modified to work in other environments as well, depending on the similarity of syntax rules.
 
<table class="wikitable">
Line 294 ⟶ 297:
 
== Notes ==
 
The character 'm' in the above regular expressions, for example m/[^abc]/, is not required in order for perl to recognize the expression as a 'match' (cf. 'substitute': s/a/b/); /[^abc]/ could just as easily be used without the preceding 'm'. The 'm' operator can be used to alter the delimiting character; for example, m{/} may be used to enhance the legibility of patterns such as /\//. See '[http://perldoc.perl.org/perlre.html perldoc perlre]' for more details.
 
== See also ==
* [[Comparison of programming languages]]
 
[[Category:Perl]]
[[Category:Pattern matching]]
[[Category:Articles with example code]]
[[Category:Programming language topics]]