Trouble with regex
Fernando Rodriguez
frr at easyjob.net
Fri Nov 14 09:36:32 EST 2003
More information about the Python-list mailing list
Fri Nov 14 09:36:32 EST 2003
- Previous message (by thread): Trouble with regex
- Next message (by thread): Trouble with regex
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I'm trying to write a regex that finds whatever is between ${ and } in a text
file.
I tried the following, but it only finds the first occurrence of the pattern:
>>> s = """asssdf${123}
dgww${one} ${two}"""
>>> what = re.compile("\$\{([^}]*)\}")
>>> m = what.search(s)
>>> m.groups()
('123',)
What am I doing wrong? O:-)
- Previous message (by thread): Trouble with regex
- Next message (by thread): Trouble with regex
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list