CL(?Pname1[a-z]+)XY(?:AB)[aeiou]+(?Pname2CD(?Pname3..)\?EF)
Good luck.
--
Steven
This is what I did in the end (in principle). Thanks.
A
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 20, 7:36 pm, Amit Gupta [EMAIL PROTECTED] wrote:
Before I read the message: I screwed up.
Let me write again
x = re.compile(CL(?Pname1[a-z]+))
# group name name1 is attached to the match of lowercase string of
alphabet
# Now I have a dictionary saying {name1, iamgood}
# I would
On Feb 20, 6:29 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Wed, 20 Feb 2008 11:36:20 -0800, Amit Gupta wrote:
Before I read the message: I screwed up.
Let me write again
x = re.compile(CL(?Pname1[a-z]+))
# group name name1 is attached to the match of lowercase
Hi
I wonder if python has a function to pack things back into regexp,
that has group names.
e.g:
exp = (?Pname1[a-z]+)
compiledexp = re.compile(exp)
Now, I have a dictionary mytable = {a : myname}
Is there a way in re module, or elsewhere, where I can have it match
the contents from dictionary
Amit Gupta wrote:
Hi
I wonder if python has a function to pack things back into regexp,
that has group names.
e.g:
exp = (?Pname1[a-z]+)
compiledexp = re.compile(exp)
Now, I have a dictionary mytable = {a : myname}
Is there a way in re module, or elsewhere, where I can have it match
Before I read the message: I screwed up.
Let me write again
x = re.compile(CL(?Pname1[a-z]+))
# group name name1 is attached to the match of lowercase string of
alphabet
# Now I have a dictionary saying {name1, iamgood}
# I would like a function, that takes x and my dictionary and return
mytable = {a : myname}
re.SomeNewFunc(compilexp, mytable)
myname
how does SomeNewFunc know to pull a as opposed to any other key?
mytable = {a : 1}
re.SomeNewFunc(compileexp, mytable)
ERROR
You could do something like one of the following 3 functions:
import re
ERROR = 'ERROR'
On Wed, 20 Feb 2008 11:36:20 -0800, Amit Gupta wrote:
Before I read the message: I screwed up.
Let me write again
x = re.compile(CL(?Pname1[a-z]+))
# group name name1 is attached to the match of lowercase string of
alphabet
# Now I have a dictionary saying {name1, iamgood}
# I would