Answers for "how to check a string contains special characters using regex pytho"

4

check if special character in string python

string = "Daneshwar$/?$Daneshwar"
regex = re.compile('[@_!#$%^&*()<>?/\|}{~:]')
if(regex.search(string) == None):
	print("special is absent")
else:
	print("present")
Posted by: Guest on June-20-2021

Code answers related to "how to check a string contains special characters using regex pytho"

Python Answers by Framework

Browse Popular Code Answers by Language