
February 11th, 2004, 01:59 AM
|
 |
Contributing User
|
|
Join Date: Jul 2003
Posts: 206
Time spent in forums: 19 h 29 m 24 sec
Reputation Power: 10
|
|
|
regular expression
Hi all,
short question concering a regular expression pattern.
Code:
line = '1 "bla \"bla\" $%1!\n" $ just "a" test'
rexEntry = re.compile('^(\d+)\s"(.*)" *(\$.*)?')
mo = rexEntry.match(line)
print mo.groups()
With this I get the following result:
Code:
('1', 'bla \"bla\" $%1!\n" $ just "a', None)
But that what I want is:
Code:
('1', 'bla \"bla\" $%1!\n', '$ just "a" test')
Can someone give me a hint?
Thanks in advance!
|