Reputation: 399
I am new to Regex, I know this is a simple question but couldn't find a solution
I have a set of special characters (&, !, $, |) and a string. I just need to check whether the string contains any of these special characters.
I tried with this but couldn't make it out.
string _validateText = ".*&!$|.*";
string _myString = Value;
if(Regex.IsMatch(_myString, _validateText))
{
//My Code
}
I ignore all the other special characters. Tried with multiple String.Contains but need to do in Regex. Please help
Upvotes: 1
Views: 2110