It might be a silly question but i can not get it working.
import re
def name_validator(value):
reg = re.compile(r'^\D*&')
if not reg.match(value):
raise ValueError
I want to match any string that do not contains digits. But it always raise ValueError.
>>> import re
def name_validator(value):
reg = re.compile(r'^\D*&')
if not reg.match(value):
raise ValueError
>>> name_validator('test')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<input>", line 5, in name_validator
ValueError