Answers for "python check if string contains special characters"

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
0

python - count values that contain special characters

special = '[(_:/,#%\=@)]'                    # Define special characters
df['count'] = df['myvar'].str.count(special) # Count them
Posted by: Guest on July-02-2020
0

python check if string contains one of characters list

if any(ext in url_string for ext in extensionsToCheck):
    print(url_string)
Posted by: Guest on December-05-2020

Code answers related to "python check if string contains special characters"

Python Answers by Framework

Browse Popular Code Answers by Language