<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16643" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>Break it down into elements.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>[^a-z]{3}</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>This says MATCH if you find 3 characters in a row which are
not lowercase alphas. None of A-D match in this case because all of them
have at least one lower-case alpha within those first 3
chars.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>Add the negative lookahead:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN
class=571261204-22052008>(?![^a-z]{3})</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>Since NONE of them matched and we're doing a NEGATIVE
lookahead then we end up with a positive and so all of A-D match
here.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=571261204-22052008><FONT face=Arial
color=#0000ff size=2>-Peter</FONT></SPAN></DIV><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Arian Hojat - armyofda12mnkeys@gmail.com
[mailto:+recoach+pbowers+7ef1bd310e.armyofda12mnkeys#gmail.com@spamgourmet.com]
<BR><B>Sent:</B> Wednesday, May 21, 2008 4:32 PM<BR><B>To:</B> General purpose
mailing list for The Regex Coach<BR><B>Subject:</B> Re: [regex-coach] negative
lookahead assertion bug? (recoach: message 9 of 20)<BR></FONT><BR></DIV>
<DIV></DIV>i think the last email was right about the pattern needing to be
([A-Z]-)(?![^a-z]{3})([a-z0-9A-Z]* ),<BR>this one is like a double NOT, almost
right?<BR><BR>Now I'm just curious with a pattern like this.... This pattern
<BR>([A-Z]-)(?![^a-z]{3}) <BR>for text: A-xyz37 # B-ab6142 # C-Wxy66 #
D-qrs93<BR>matches<BR><SPAN style="COLOR: rgb(255,0,0)">A-</SPAN>xyz37 # <SPAN
style="COLOR: rgb(255,0,0)">B-</SPAN>ab6142 # <SPAN
style="COLOR: rgb(255,0,0)">C-</SPAN>Wxy66 # <SPAN
style="COLOR: rgb(255,0,0)">D-</SPAN>qrs93<BR><BR>Its looking to make sure the
next thing after Capital Letter dash isnt 3 lower case letters, then 'nots'
it? <BR>aka it really looks ahead for 3 lowercase letters, and i thought would
only match A- and D-.<BR><BR>Thanks for the help btw, I wasnt sure if these
were problems with program or just me understanding regexes bad :) which is
most likely the case.<BR>Arian<BR><BR><BR>
<DIV class=gmail_quote>2008/5/21 Laurent TAUPIAC <<A
href="mailto:ltaupiac@lfdj.com" target=_blank>ltaupiac@lfdj.com</A>>:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV text="#000000" bgcolor="#ffffff">Negative lookup assertion should match
to be validate.<BR>If "Wxy" not match, the positive assertion
failed.<BR><BR>If you want a Capital letter followed by a dash but not
followed by 3 lower case, you should match "not 3 lower case"
<DIV><BR>([A-Z]-)(?![^a-z]{3})([a-z0-9]*
)<BR><BR><BR></DIV>Regards<BR><BR>Arian Hojat a écrit :
<BLOCKQUOTE type="cite">
<DIV>
<DIV></DIV>
<DIV>Hello all,<BR><BR>had a question/possible bug report...<BR>For the
example on this webpage:<BR><A
href="http://www.nuclearblender.com/leftovers/howto/regex/"
target=_blank>http://www.nuclearblender.com/leftovers/howto/regex/</A><BR><BR>this
pattern is presented and i tried a positive lookup assertion which worked,
but this first negative one only matched the first pattern (global option
is on btw, so not sure why wont match).<BR>Pattern:
([A-Z]-)(?![a-z]{3})([a-z0-9]* )<BR>Text to lookup: A-xyz37 # B-ab6142 #
C-Wxy66 # D-qrs93<BR><BR>Should match B-ab6142 and C-Wxy66 as they both
(have a capital letter followed by a dash), then (dont have 3 lower case
letters), and (are following by letters/numbers and a space)<BR>only
matches first one in the program.<BR><BR>Thanks, let me know if it should
match only one if im wrong. Running latest version on Windows XP.<BR>Great
Tool!<BR>Arian<BR></DIV></DIV><PRE><HR width="90%" SIZE=4>
_______________________________________________
regex-coach site list
<A href="mailto:regex-coach@common-lisp.net" target=_blank>regex-coach@common-lisp.net</A>
<A href="http://common-lisp.net/mailman/listinfo/regex-coach" target=_blank>http://common-lisp.net/mailman/listinfo/regex-coach</A></PRE></BLOCKQUOTE><BR><BR><PRE cols="200">--
---------------------------------------------------------------------
Sorry, This disclamer is auto added by my company's FW
---------------------------------------------------------------------
</PRE></DIV><BR><BR>Si vous n'etes pas destinataires de ce message, merci
d'avertir l'expediteur de l'erreur de distribution et de le detruire
immediatement.<BR>Ce message contient des informations confidentielles ou
appartenant a La Francaise des Jeux. Il est etabli a l'intention exclusive
de ses destinataires. Toute divulgation, utilisation, diffusion ou
reproduction (totale ou partielle) de ce message ou des informations qu'il
contient, doit etre prealablement autorisee.<BR>Tout message electronique
est susceptible d'alteration et son integrite ne peut etre assuree. La
Francaise des Jeux decline toute responsabilite au titre de ce message s'il
a ete modifie ou falsifie.<BR><BR>If you are not the intended recipient of
this e-mail, please notify the sender of the wrong delivery and delete it
immediately from your system.<BR>This e-mail contains confidential
information or information belonging to La Francaise des Jeux and is
intended solely for the addressees. The unauthorised disclosure, use,
dissemination or copying (either whole or partial) of this e-mail, or any
information it contains, is prohibited.<BR>E-mails are susceptible to
alteration and their integrity cannot be guaranteed. La Francaise des Jeux
shall not be liable for this e-mail if modified or
falsified.<BR>_______________________________________________<BR>regex-coach
site list<BR><A href="mailto:regex-coach@common-lisp.net"
target=_blank>regex-coach@common-lisp.net</A><BR><A
href="http://common-lisp.net/mailman/listinfo/regex-coach"
target=_blank>http://common-lisp.net/mailman/listinfo/regex-coach</A><BR></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>