Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31994

Re: regex function driving me nuts

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'debugging': 0.05; 'newline': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'str,': 0.09; 'def': 0.10; 'marker': 0.16; 'match:': 0.16; 'oct': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'martin': 0.16; 'tests': 0.18; 'idea': 0.24; 'tried': 0.25; 'thanks!': 0.26; 'header:X -Complaints-To:1': 0.28; "i'm": 0.29; 'print': 0.32; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'list': 0.35; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'your': 0.60; 'everything.': 0.84; 'dennis': 0.91; 'received:108': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: regex function driving me nuts
Date Wed, 24 Oct 2012 01:27:04 -0400
Organization > Bestiaria Support Staff <
References <0becd1f8-e760-49c1-88d6-1c11b49e203c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-108-79-220-228.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 3.3/32.846
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2718.1351056598.27098.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1351056598 news.xs4all.nl 6943 [2001:888:2000:d::a6]:54246
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31994

Show key headers only | View raw


On Tue, 23 Oct 2012 12:51:34 -0700 (PDT), "MartinD."
<cyberdicks@gmail.com> declaimed the following in
gmane.comp.python.general:

> Hi, 
> 
> I'm new to Python. 
> Does someone has an idea what's wrong.  I tried everything. The only regex that is tested is the last one in a whole list of regex in keywords.txt
> Thanks! 
> Martin 
> 
> 
> ########
> def checkKeywords( str, lstKeywords ):
> 
> 	for regex in lstKeywords: 
> 		match = re.search(regex, str,re.IGNORECASE)
> 		# If-statement after search() tests if it succeeded
> 		if match:                      
> 			print match.group() ##just debugging
> 			return match.group() ## 'found!
> 			
> 	return
> 
> #########
> 
> keywords1 = [line for line in open('keywords1.txt')]

	Off-hand, your list of "keywords1" still has a newline marker at the
end of each entry...
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

regex function driving me nuts "MartinD." <cyberdicks@gmail.com> - 2012-10-23 12:51 -0700
  RE: regex function driving me nuts "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-10-23 20:29 +0000
  Re: regex function driving me nuts Ian Kelly <ian.g.kelly@gmail.com> - 2012-10-23 14:32 -0600
  Re: regex function driving me nuts Vlastimil Brom <vlastimil.brom@gmail.com> - 2012-10-23 22:36 +0200
    Re: regex function driving me nuts cyberdicks@gmail.com - 2012-10-23 16:51 -0700
    Re: regex function driving me nuts cyberdicks@gmail.com - 2012-10-23 16:51 -0700
  Re: regex function driving me nuts Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-10-24 01:27 -0400

csiph-web