I am trying to check a search box and this is my query which works but has a couple of problems.
// =================================
var check = new Regex("[^A-Za-z]");
Match m = check.Match(searchQuery);
if (m.Equals(check) != true)
{
pnl_Message.Visible = true;
pnl_Message.CssClass = "messageTable";
lbl_message.Text = " * Only Letters are allowed";
}
The If statement Equals says Suspicious comparison !
but works!
the thing is it always goes in the if statement no matter what I set the expression too.
How should I be Querying the searchQuery?