Content deleted Content added
RevRagnarok (talk | contribs) |
article upgrade ;; see discussion page wp_tpa_upgrade for more details |
||
Line 1:
A [[regular expression]] (also "Regex" 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 programming language.
== Examples ==
Here are some examples of [[Perl]] [[regular expression]]s.
<table class="wikitable">
<tr>
<th>Metacharacter(s)</th>
<th>Description</th>
<th>Example
Line 290 ⟶ 293:
</table></center>
== Notes ==
The '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.▼
▲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.
[[Category:Perl]]
|