Re: regexp match string with word1 and not word2
- From: Flyzone <flyzone@xxxxxxxxxxxxxxxx>
- Date: 30 Apr 2007 08:20:58 -0700
James Stroud ha scritto:
The P.S: suggests homework, but this can't be homework because python
regex won't do this, so your teacher gets an F if its homework. You
Not a homework, but a "workwork" :-)
I'm writing a script to parse logfiles, and I have began to study
python for this (bash was too much slow).
When i'll finishi it, I'll post a link here if someone think that
could be helpful.
require a negative look-behind assertion of variable length--not
possible in python regex. You will have to use something else--or maybe
you don't understand the homework problem.
I was asking that cause in the code i wrote this:
for y in range(0, len(skip_lst) ):
if (re.search(skip_lst[y], line)):
skip=1
break
In skip_lst there are the regexp and strings (on one line) to match
with "line".
But rarely the rules to be matched need to have also a logical And.
What could be the solution? Add another array with a "not" regexp?
.
- Follow-Ups:
- Re: regexp match string with word1 and not word2
- From: Marc 'BlackJack' Rintsch
- Re: regexp match string with word1 and not word2
- References:
- regexp match string with word1 and not word2
- From: Flyzone
- Re: regexp match string with word1 and not word2
- From: James Stroud
- regexp match string with word1 and not word2
- Prev by Date: RE: import structures
- Next by Date: Re: regexp match string with word1 and not word2
- 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):
Relevant Pages
|