I need to find whether a given string is in this format or not.
anystr3ing1 : somesrritn3g
following is my code
prog = re.compile("([a-zA-Z0-9]\D)" + ":" + ([a-zA-Z0-9]\D)")
with open('data.txt','ru') as openfileobject:
for line in openfileobject:
if prog.match(line):
print line
however its not giving any output
+and([a-zA-Z0-9]\D)")near the end of the line.