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:.',
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
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
try this. maybe this is what you want?
reg = re.compile('Name:.*\\n', re.IGNORECASE)
--
http://mail.python.org/mailman/listinfo/python-list
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