Re: regexp match string with word1 and not word2
- From: Marc 'BlackJack' Rintsch <bj_666@xxxxxxx>
- Date: Mon, 30 Apr 2007 19:49:43 +0200
In <1177946458.620210.68690@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Flyzone wrote:
for y in range(0, len(skip_lst) ):
if (re.search(skip_lst[y], line)):
skip=1
break
Please try to avoid unnecessary indexes::
for regexp in skip_list:
if re.search(regexp, line):
skip = True
break
And if you don't intent to count the `skip`\s a `True` seems to be more
readable.
Ciao,
Marc 'BlackJack' Rintsch
.
- References:
- regexp match string with word1 and not word2
- From: Flyzone
- Re: regexp match string with word1 and not word2
- From: James Stroud
- Re: regexp match string with word1 and not word2
- From: Flyzone
- regexp match string with word1 and not word2
- Prev by Date: Re: Re-running script from Tk shell
- Next by Date: re-importing modules
- Previous by thread: Re: regexp match string with word1 and not word2
- Next by thread: Re: regexp match string with word1 and not word2
- Index(es):