Reputation: 1859
What should be the regular expression if i need to show the error if the string contains character other than letters, digits, blank, underscore (_), dash (-), dollar sign ($), at sign (@),open curly brace ({), close curly brace (}) and pound sign (#)
Regex.IsMatch(myString, ?????????, RegexOptions.IgnoreCase)
Thanks..
Upvotes: 0
Views: 54
Reputation: 348
You can use this expression :
^[a-zA-Z0-9\ _#\-\$\{\}@]*$
PS : Usefull tool to create REGEX : https://www.debuggex.com/
Upvotes: 1