N
Narayana Reddy GundReddy
Guest
Dear all,
I have a requirement to check if two words exist in a string.
I have written below code, but that is not working. For example, in the below code, I want to have both words Hi and hello existing in the string, "check". How to write regular expression to have both words Hi and hello any where in the string.
Please advise and thank you for your time and suggestion.
=============================================
Regex rx = new Regex(@"(Hi&hello)");
string check = "Hi and hello every one";
if (rx.IsMatch(check))
{
Console.WriteLine("string contains either Odoo or #rules");
}
==============================================
Narayana Reddy G
Continue reading...
I have a requirement to check if two words exist in a string.
I have written below code, but that is not working. For example, in the below code, I want to have both words Hi and hello existing in the string, "check". How to write regular expression to have both words Hi and hello any where in the string.
Please advise and thank you for your time and suggestion.
=============================================
Regex rx = new Regex(@"(Hi&hello)");
string check = "Hi and hello every one";
if (rx.IsMatch(check))
{
Console.WriteLine("string contains either Odoo or #rules");
}
==============================================
Narayana Reddy G
Continue reading...