0

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..

1 Answer 1

1

You can use this expression :

^[a-zA-Z0-9\ _#\-\$\{\}@]*$

PS : Usefull tool to create REGEX : https://www.debuggex.com/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.