Python check if string contains special characters

Code examples

0
0

python - count values that contain special characters

special = '[(_:/,#%\=@)]'                    # Define special characters
df['count'] = df['myvar'].str.count(special) # Count them
0
0

python check if string contains one of characters list

if any(ext in url_string for ext in extensionsToCheck):
    print(url_string)

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................