From armyofda12mnkeys at gmail.com Tue May 20 15:44:27 2008 From: armyofda12mnkeys at gmail.com (Arian Hojat) Date: Tue, 20 May 2008 11:44:27 -0400 Subject: [regex-coach] negative lookahead assertion bug? Message-ID: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> Hello all, had a question/possible bug report... For the example on this webpage: http://www.nuclearblender.com/leftovers/howto/regex/ 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). Pattern: ([A-Z]-)(?![a-z]{3})([a-z0-9]* ) Text to lookup: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 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) only matches first one in the program. Thanks, let me know if it should match only one if im wrong. Running latest version on Windows XP. Great Tool! Arian -------------- next part -------------- An HTML attachment was scrubbed... URL: From recoach.z.pbowers at spamgourmet.com Tue May 20 17:38:27 2008 From: recoach.z.pbowers at spamgourmet.com (recoach.z.pbowers at spamgourmet.com) Date: Tue, 20 May 2008 19:38:27 +0200 Subject: [regex-coach] negative lookahead assertion bug? message 7 of 20) In-Reply-To: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> References: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> Message-ID: This ([a-z0-9]* ) will only match lowercase letters. The capital W will not be matched. Thus only B-ab6142 will match. Use Pattern: ([A-Z]-)(?![a-z]{3})([a-zA-Z0-9]* ) If you want it to match the C- pattern as well. -Peter > -----Original Message----- > From: Arian Hojat - armyofda12mnkeys at gmail.com > [mailto:+recoach+pbowers+7ef1bd310e.armyofda12mnkeys#gmail.com > @spamgourmet.com] > Sent: Tuesday, May 20, 2008 5:44 PM > To: regex-coach at common-lisp.net > Subject: [regex-coach] negative lookahead assertion bug? > (recoach: message 7 of 20) > > Hello all, > > had a question/possible bug report... > For the example on this webpage: > http://www.nuclearblender.com/leftovers/howto/regex/ > > 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). > Pattern: ([A-Z]-)(?![a-z]{3})([a-z0-9]* ) > Text to lookup: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 > > 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) > only matches first one in the program. > > Thanks, let me know if it should match only one if im wrong. > Running latest version on Windows XP. > Great Tool! > Arian > > From ltaupiac at lfdj.com Wed May 21 06:36:30 2008 From: ltaupiac at lfdj.com (Laurent TAUPIAC) Date: Wed, 21 May 2008 08:36:30 +0200 Subject: [regex-coach] negative lookahead assertion bug? In-Reply-To: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> References: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> Message-ID: <4833C2EE.4050601@lfdj.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- Si vous n'etes pas destinataires de ce message, merci d'avertir l'expediteur de l'erreur de distribution et de le detruire immediatement. 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. 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. 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. 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. 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. From armyofda12mnkeys at gmail.com Wed May 21 14:32:26 2008 From: armyofda12mnkeys at gmail.com (Arian Hojat) Date: Wed, 21 May 2008 10:32:26 -0400 Subject: [regex-coach] negative lookahead assertion bug? In-Reply-To: <4833C2EE.4050601@lfdj.com> References: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> <4833C2EE.4050601@lfdj.com> Message-ID: <797650580805210732y3f88403aj911ef29f995824a5@mail.gmail.com> i think the last email was right about the pattern needing to be ([A-Z]-)(?![^a-z]{3})([a-z0-9A-Z]* ), this one is like a double NOT, almost right? Now I'm just curious with a pattern like this.... This pattern ([A-Z]-)(?![^a-z]{3}) for text: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 matches A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 Its looking to make sure the next thing after Capital Letter dash isnt 3 lower case letters, then 'nots' it? aka it really looks ahead for 3 lowercase letters, and i thought would only match A- and D-. 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. Arian 2008/5/21 Laurent TAUPIAC : > Negative lookup assertion should match to be validate. > If "Wxy" not match, the positive assertion failed. > > If you want a Capital letter followed by a dash but not followed by 3 lower > case, you should match "not 3 lower case" > ([A-Z]-)(?![^a-z]{3})([a-z0-9]* ) > > > Regards > > Arian Hojat a ?crit : > > Hello all, > > had a question/possible bug report... > For the example on this webpage: > http://www.nuclearblender.com/leftovers/howto/regex/ > > 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). > Pattern: ([A-Z]-)(?![a-z]{3})([a-z0-9]* ) > Text to lookup: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 > > 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) > only matches first one in the program. > > Thanks, let me know if it should match only one if im wrong. Running latest > version on Windows XP. > Great Tool! > Arian > > ------------------------------ > > _______________________________________________ > regex-coach site listregex-coach at common-lisp.nethttp://common-lisp.net/mailman/listinfo/regex-coach > > > > -- > > > > > > --------------------------------------------------------------------- > Sorry, This disclamer is auto added by my company's FW > --------------------------------------------------------------------- > > > > > > > > > > > > > > > > > > > > > > > > > > > > Si vous n'etes pas destinataires de ce message, merci d'avertir > l'expediteur de l'erreur de distribution et de le detruire immediatement. > 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. > 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. > > 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. > 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. > 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. > _______________________________________________ > regex-coach site list > regex-coach at common-lisp.net > http://common-lisp.net/mailman/listinfo/regex-coach > -------------- next part -------------- An HTML attachment was scrubbed... URL: From recoach.z.pbowers at spamgourmet.com Thu May 22 04:17:26 2008 From: recoach.z.pbowers at spamgourmet.com (recoach.z.pbowers at spamgourmet.com) Date: Thu, 22 May 2008 06:17:26 +0200 Subject: [regex-coach] negative lookahead assertion bug? message 9 of 20) In-Reply-To: <797650580805210732y3f88403aj911ef29f995824a5@mail.gmail.com> References: <797650580805200844m42056b92mdbf880d1b6dc4ed8@mail.gmail.com> <4833C2EE.4050601@lfdj.com> <797650580805210732y3f88403aj911ef29f995824a5@mail.gmail.com> Message-ID: Break it down into elements. [^a-z]{3} 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. Add the negative lookahead: (?![^a-z]{3}) 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. -Peter _____ From: Arian Hojat - armyofda12mnkeys at gmail.com [mailto:+recoach+pbowers+7ef1bd310e.armyofda12mnkeys#gmail.com at spamgourmet.c om] Sent: Wednesday, May 21, 2008 4:32 PM To: General purpose mailing list for The Regex Coach Subject: Re: [regex-coach] negative lookahead assertion bug? message 9 of 20) i think the last email was right about the pattern needing to be ([A-Z]-)(?![^a-z]{3})([a-z0-9A-Z]* ), this one is like a double NOT, almost right? Now I'm just curious with a pattern like this.... This pattern ([A-Z]-)(?![^a-z]{3}) for text: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 matches A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 Its looking to make sure the next thing after Capital Letter dash isnt 3 lower case letters, then 'nots' it? aka it really looks ahead for 3 lowercase letters, and i thought would only match A- and D-. 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. Arian 2008/5/21 Laurent TAUPIAC : Negative lookup assertion should match to be validate. If "Wxy" not match, the positive assertion failed. If you want a Capital letter followed by a dash but not followed by 3 lower case, you should match "not 3 lower case" ([A-Z]-)(?![^a-z]{3})([a-z0-9]* ) Regards Arian Hojat a ?crit : Hello all, had a question/possible bug report... For the example on this webpage: http://www.nuclearblender.com/leftovers/howto/regex/ 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). Pattern: ([A-Z]-)(?![a-z]{3})([a-z0-9]* ) Text to lookup: A-xyz37 # B-ab6142 # C-Wxy66 # D-qrs93 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) only matches first one in the program. Thanks, let me know if it should match only one if im wrong. Running latest version on Windows XP. Great Tool! Arian _____ _______________________________________________ regex-coach site list regex-coach at common-lisp.net http://common-lisp.net/mailman/listinfo/regex-coach -- --------------------------------------------------------------------- Sorry, This disclamer is auto added by my company's FW --------------------------------------------------------------------- Si vous n'etes pas destinataires de ce message, merci d'avertir l'expediteur de l'erreur de distribution et de le detruire immediatement. 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. 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. 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. 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. 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. _______________________________________________ regex-coach site list regex-coach at common-lisp.net http://common-lisp.net/mailman/listinfo/regex-coach -------------- next part -------------- An HTML attachment was scrubbed... URL: