regex check if string contains only certain characters code example Example: How to check a string for specific characters? if '$' in myString: