I'm running a snippest like that:
p = re.compile(b'^((?!-)[*A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{2,6}$')
m = p.match(domain)
'domain' are the ip addresses get from google dns. I know there is something wrong with the decoding, so I've tried to encode the regular expressions after it was compiled, but still get the bug notice like this,
Traceback (most recent call last):
File "D:\python34\lib\threading.py", line 921, in _bootstrap_inner
self.run()
File "update.py", line 101, in run
if validate_domain(domain):
File "update.py", line 182, in validate_domain
m = pattern.match(domain)
TypeError: can't use a bytes pattern on a string-like object
Could you give me some tips for this situation
!!!Programming language: python 3.4