In URE, Does anyone know how to escape the '=' in the regEx? I cant seem to isolate the GET var's without looking for the '=' in the middle.
Thank you!!
Code: Select all
import ure
MyString = "GET http://test.ing/test.html?Test=Value&another=one&here=two HTTP/1.1"
reg = ure.match("([A-Z]+)", MyString)
variables = ure.match("([A-z]+)[\=]([A-z]+)", MyString)
print(reg)
i=0
while 1:
try:
if reg is None:
break
else:
print(reg.group(i))
i+=1
except IndexError as e:
#print("Index Exception: {0}".format(e), type(e))
break
except Exception as e:
print("Exception: {0}".format(e), type(e))
break
print(variables)
i=0
while 1:
try:
if variables is None:
break
else:
print(variables.group(i))
i+=1
except AttributeError as e:
print("Attribute Exception: {0}".format(e), type(e))
break
except IndexError as e:
#print("Index Exception: {0}".format(e), type(e))
break
except Exception as e:
print("Exception: {0}".format(e), type(e))
break