I have a string which is allowed to contain only alphabets, numbers, empty spaces and symbol ':'. So I wrote the following code :
regex = r'![a-zA-Z0-9\:\ ]+'
print re.match(regex, myString)
However it does not seem to work. I tried different combinations r'?!([a-zA-Z0-9\:\ ])+' and also with re.search, but it does not seem to work. Any help?