Re: Regular Expression Syntax Help

2006-02-08 Thread Raja Raman Sundararajan
Oh! yes you can use re for that. You just need to change the pattern a bit I did not understand where the title will be so I have ignored it, but I got something below which will be helpful for you value = name:asasasasas\nrequest: play\ntitle reg = re.compile('Name:.*\\nrequest:.',

Regular Expression Syntax Help

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] Name: David Dude [USELESS DATA] Right now, I'm using the following code: pattern_Name= '''(?x) Title:\s+(\w+)\s+ ''' names = re.findall(pattern_Name, myString) print

Re: Regular Expression Syntax Help

2006-02-07 Thread Ernesto
The word Title there should be Name. What I really need is the pattern for getting the entire string after Name: until a '\n' is found. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression Syntax Help

2006-02-07 Thread Raja Raman Sundararajan
try this. maybe this is what you want? reg = re.compile('Name:.*\\n', re.IGNORECASE) -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression Syntax Help

2006-02-07 Thread Ernesto
So now I need to add the requirement that only Name: 's which are followed by Request: Play or Request: Next ANYWHERE between the previous titles and the new titles. Can I use RE's for that ? Ernesto wrote: I'm trying to get the right syntax for my regular expression. The string I'm trying