how to restrict special chars in REGEXP

I am doing to validate textbox field. Here the below code i validated like it should contain chars and decimal numbers and spaces only allowed in regexp. But now i want to do like that it should restrict special chars. The below code allowed the special chars. Cany anyone help me to do this

  p = re.compile('[a-zA-z0-9_](w+ ?)(?:([0-9])+([,.][0-9]+))?')

Thanks in advance


Source: regex

Leave a Reply