Below is code:
import re
string = "02:222222"
if re.match(r'[a-fA-F0-9]+[a-fA-F0-9]+:+[a-fA-F0-9]+[a-fA-F0-9]+$',string):
print "pass"
else:
print "fail"
above code is printing "pass"
my expected output should be "fail"
Below are the few examples:
string = 00:20
expected output: pass
string = 00:202
expected ouput: fail
string = 00:2z
expected output: fail
string = 000:2
expected ouput: fail