This page contains examples of perl regular expressions. There are many other kinds! Perl isn't the first, most common, or only language that supports regexes
| This article was nominated for deletion on 3 January 2008. The result of the discussion was keep. |
| This redirect does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
| |||||||||||
This page contains examples of perl regular expressions. There are many other kinds! Perl isn't the first, most common, or only language that supports regexes... sed, for example, probably has a larger installed base and certainly was written long before perl.
It's like we made a page that showed nothing but Ford F-150 pickups and titled it "Examples of motorized vehicles". It's not entirely wrong, yet very misleading to anyone who is not already an expert. —Preceding unsigned comment added by 205.153.180.229 (talk) 17:14, 3 May 2011 (UTC)
The last paragraph:
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 'perldoc perlre' for more details.
needs improvement.
This article should probably be synchronized with http://en.wikibooks.org/wiki/Programming:Perl_Regular_expressions_reference
The last example is wrong, as of 09 Mar 2006. --Jidanni 2006-04-16
$ cat pt
$string1 = "Hello World\n";
if ($string1 =~ m/[^abc]/) {
print "$string1 does not contain the characters ";
print "a, b, and c\n";
}
$ perl pt Hello World does not contain the characters a, b, and c
No, it actually is wrong. Try it with the string "What do you mean?", and even though that string contains "a" (twice), it'll still say "does not contain the characters a, b, and c". The problem is that the regex is matching "any string that contains at least one character that isn't a, b, or c", not "the entire string consists of characters other than a, b, and c". So the message isn't the same as the regex. --Randal L. Schwartz 17:42, 20 April 2006 (UTC)
If you have questions, please see WP:TPA and note:
Some change is appropriate to ensure this article does not come under attack as being unencyclopedic, non-notable or otherwise not providing sufficient context to justify a stand-alone article. dr.ef.tymac 14:03, 31 March 2007 (UTC)
Follow-up: Changed to a redir to "Regular expression examples" to further preempt potential "notability" attacks. Perl is still the basis for the examples, but now the article indicates that the examples may also be translated to other languages or libraries. dr.ef.tymac 15:49, 31 March 2007 (UTC)
This article currently offers nothing that isn't found on a thousand other simple regex tutorial pages and help files. Plus, it is Perl specific. Why does this article even exist? --Monger 00:15, 1 September 2007 (UTC)
It might be worthwhile to pick one example and show how to implement it in different languages. For example, PHP users would benefit knowing it's PCRE (preg) and not POSIX (ereg). A side benefit to this might be the ability to simply list the other expressions in a table without language specific syntax although I'm unsure about that, I do like actual working examples and Perl is certainly the proper choice for that. Maybe others have thoughts on these topics. Philipolson (talk) 10:15, 15 February 2008 (UTC)
This article does contain some useful content and would make a great addition to the Regular expressions article. I must agree with Xosé that this article should be merged rather than being deleted. To further this proposition, I have posted the merger template on the top of the article. --Alex rosenberg35 (talk) 05:33, 27 December 2008 (UTC)
I think, this article should be removed. It seems an (almost) exact copy of this article: http://en.wikibooks.org/wiki/Programming:Perl_Regular_expressions_reference
And since it is very Perl-specific syntax (a lot of the RE atoms are not recognized by grep, for instance), it should not be just merged into the general "Regular expressions" article.
Gabriel (talk) 16:24, 17 December 2009 (UTC)
to the concept of regular expressions, than using 'hello world' from a C program.
example.. perhaps Shakespeare or poetry or a famous speech.
just an idea. Decora (talk) 21:11, 19 November 2010 (UTC) 21:08, 19 November 2010 (UTC)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.