Search a variable for an address
Posted
by chrissygormley
on Stack Overflow
See other posts from Stack Overflow
or by chrissygormley
Published on 2010-04-07T11:05:29Z
Indexed on
2010/04/07
11:13 UTC
Read the original article
Hit count: 320
Hello,
I am trying to match information stored in a variable. I have a list of uuid's and ip addresses beside them. The code I have is:
r = re.compile(r'urn:uuid:5EEF382F-JSQ9-3c45-D5E0-K15X8M8K76')
m = r.match(str(serv))
if m1:
print'Found'
The string serv contains is:
urn:uuid:7FDS890A-KD9E-3h53-G7E8-BHJSD6789D:[u'http://10.10.10.20:12365/7FDS890A-KD9E-3h53-G7E8-BHJSD6789D/']
---------------------------------------------
urn:uuid:5EEF382F-JSQ9-3c45-D5E0-K15X8M8K76:[u'http://10.10.10.10:42365']
---------------------------------------------
urn:uuid:8DSGF89S-FS90-5c87-K3DF-SDFU890US9:[u'http://10.10.10.40:5234']
---------------------------------------------
So basically I am wanting to find the uuid string and find out what it's address is and store it as a variable. So far I have just tried to get it to match the string to no avail. Can anyone point out a solution to this.
Thanks
© Stack Overflow or respective owner