On May 2, 9:17 am, Flyzone <[EMAIL PROTECTED]> wrote:
> On 30 Apr, 20:00, Steven Bethard <[EMAIL PROTECTED]> wrote:
...
> Maybe a right approach will be another if after the first one? Like:
>for y in range(0, len(skip_lst) ):
> if (re.search(skip_lst[y], line)):
>
On 30 Apr, 20:00, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Well then it seems like you might want to rethink this rule-file
> approach since your problem is clearly not amenable to regular expressions.
[cut]
> That said, here's a regexp that might work::
> ((?!two:).)*one((?!two:).)*
> That
On Apr 30, 6:49 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Flyzone wrote:
> > for y in range(0, len(skip_lst) ):
> > if (re.search(skip_lst[y], line)):
> > skip=1
> >break
>
> Pleas
Flyzone wrote:
> On 30 Apr, 17:11, Steven Bethard <[EMAIL PROTECTED]> wrote:
>
>> You don't need a regexp:;
>
> I need a regexp.i'm parsing a file with a rule-file that contains
> also regexp and strings too
Well then it seems like you might want to rethink this rule-file
approach since
In <[EMAIL PROTECTED]>, 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.sea
On Mon, 2007-04-30 at 08:22 -0700, Flyzone wrote:
> On 30 Apr, 17:11, Steven Bethard <[EMAIL PROTECTED]> wrote:
>
> > You don't need a regexp:;
>
> I need a regexp.i'm parsing a file with a rule-file that contains
> also regexp and strings too
That was not at all evident from your origin
On 30 Apr, 17:11, Steven Bethard <[EMAIL PROTECTED]> wrote:
> You don't need a regexp:;
I need a regexp.i'm parsing a file with a rule-file that contains
also regexp and strings too
Read my post to James Stroud.
--
http://mail.python.org/mailman/listinfo/python-list
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 t
Flyzone wrote:
> Hello,
> i have again problem with regexp :-P
> I need to match all lines that contain one word but not contain
> another.
> Like to do "grep one | grep -v two:"
You don't need a regexp:;
if 'one' in line and 'two:' not in line:
... do something...
STeVe
--
http:/
Flyzone wrote:
> P.S: i can't have more re.search, so [clip]
This reminds me of a quote by the Great Researcher Roy Garcia:
If it worked the first time, they'd just call it "search".
James
--
http://mail.python.org/mailman/listinfo/python-list
Flyzone wrote:
> Hello,
> i have again problem with regexp :-P
> I need to match all lines that contain one word but not contain
> another.
> Like to do "grep one | grep -v two:"
> The syntax of the string is:
> (any printable char)two:(any printable char)one(any printable char)
> Example:
> Apr 30
Hello,
i have again problem with regexp :-P
I need to match all lines that contain one word but not contain
another.
Like to do "grep one | grep -v two:"
The syntax of the string is:
(any printable char)two:(any printable char)one(any printable char)
Example:
Apr 30 00:00:09 v890neg0 two: [ID 70291
12 matches
Mail list logo