Re: tricky regular expressions

2006-02-08 Thread Elezar Simeon Papo
I had a somewhat similar problem that got solved with a line-based state machine parser. Cheers, Elezar = Wiki Dictionary - Bosnian/Croatian/Serbian http://izraz.com/%C4%8Cengi%C4%87_vila -- http://mail.python.org/mailman/listinfo/python-list

Re: tricky regular expressions

2006-02-07 Thread Ernesto
Petr Jakes wrote: > PS: just wonder why are you asking the same question in two different > topics Thanks for the help Peter. That happened accidentally. I meant to only put that in python topic. Aplogies... -- http://mail.python.org/mailman/listinfo/python-list

Re: tricky regular expressions

2006-02-07 Thread Petr Jakes
try to google for "finit state machine" OR "state machine" OR FSM titles =["USELESS DATA","Request : Play", "USELESS DATA","Title: Beethoven's 5th", "USELESS DATA","Request : next","USELESS DATA", "Title: song# 2 ","USELESS DATA","Request : Play", "USELESS DATA","Title: Beethoven's 5th", "USELESS

Re: tricky regular expressions

2006-02-07 Thread Xavier Morel
Ernesto wrote: > Xavier Morel wrote: >> Ernesto wrote: >>> I'm not sure if I should use RE's or some other mechanism. Thanks >>> >> I think a line-based state machine parser could be a better idea. Much >> simpler to build and debug if not faster to execute. > > What is a line-based state machine

Re: tricky regular expressions

2006-02-07 Thread Ernesto
Xavier Morel wrote: > Ernesto wrote: > > I'm not sure if I should use RE's or some other mechanism. Thanks > > > I think a line-based state machine parser could be a better idea. Much > simpler to build and debug if not faster to execute. What is a line-based state machine ? -- http://mail.pyt

Re: tricky regular expressions

2006-02-07 Thread Mitja Trampus
[hint: posting the same question in newsgroups generally does not help to get responses any quicker] Ernesto wrote: > The string I'm getting data from looks like this: > [USELESS DATA] > Request : Play > [USELESS DATA] > Title: Beethoven's 5th > [USELESS DATA] > Request : next > [USELESS

Re: tricky regular expressions

2006-02-07 Thread Xavier Morel
Ernesto wrote: > I'm not sure if I should use RE's or some other mechanism. Thanks > I think a line-based state machine parser could be a better idea. Much simpler to build and debug if not faster to execute. -- http://mail.python.org/mailman/listinfo/python-list

tricky regular expressions

2006-02-07 Thread Ernesto
So regular expressions have been good to me so far, but now my problem is a bit trickier. The string I'm getting data from looks like this: myString = [USELESS DATA] Request : Play [USELESS DATA] Title: Beethoven's 5th [USELESS DATA] Request : next [USELESS DATA] Title: song #2 . I'm using

tricky regular expressions

2006-02-07 Thread Ernesto
I'm trying to get the right syntax for my regular expression. The string I'm trying to parse is: # myString [USELESS DATA] Request: Play [USELESS DATA] Name: David Dude [USELESS DATA] Request: Next [USELESS DATA] Name: Ernesto Python User # Right now, I'm using the following code: patter