cvs commit: perlfaq perlfaq6.pod
[email protected] (Robert Spier) 5 May 2004 03:51:37 -0000
| Newsgroups | perl.cvs.perlfaq |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 04/05/04 20:51:37 Modified: . perlfaq6.pod Log: From: SADAHIRO Tomoyuki <[email protected]> To: [email protected] Subject: [perlfaq6] detypo: (?!<) shoulbe be replaced by (?<!) Date: Wed, 05 May 2004 10:53:03 +0900 Revision Changes Path 1.23 +4 -4 perlfaq/perlfaq6.pod Index: perlfaq6.pod =================================================================== RCS file: /cvs/public/perlfaq/perlfaq6.pod,v retrieving revision 1.22 retrieving revision 1.23 diff -u -w -r1.22 -r1.23 --- perlfaq6.pod 21 Sep 2003 06:02:10 -0000 1.22 +++ perlfaq6.pod 5 May 2004 03:51:37 -0000 1.23 @@ -1,6 +1,6 @@ =head1 NAME -perlfaq6 - Regular Expressions ($Revision: 1.22 $, $Date: 2003/09/21 06:02:10 $) +perlfaq6 - Regular Expressions ($Revision: 1.23 $, $Date: 2004/05/05 03:51:37 $) =head1 DESCRIPTION @@ -748,14 +748,14 @@ Goldberg: $martian =~ m/ - (?!<[A-Z]) + (?<![A-Z]) (?:[A-Z][A-Z])*? GX /x; This succeeds if the "martian" character GX is in the string, and fails -otherwise. If you don't like using (?!<), you can replace (?!<[A-Z]) -with (?:^|[^A-Z]). +otherwise. If you don't like using (?<!), a zero-width negative +look-behind assertion, you can replace (?<![A-Z]) with (?:^|[^A-Z]). It does have the drawback of putting the wrong thing in $-[0] and $+[0], but this usually can be worked around.