Regular Expression check for non matching string

  • Thread starter Thread starter outoftherealm
  • Start date Start date
O

outoftherealm

I am trying to write a regular expression to ensure the selected value
is not equal to a specified string.

something like !~/^(Select Salesperson)$/;

Thanks!
 
(e-mail address removed) wrote in
I am trying to write a regular expression to ensure the selected
value is not equal to a specified string.

something like !~/^(Select Salesperson)$/;

Just use the boolean ! (not) operator:

if (!Regex.IsMatch(inputString, "Select Salesperson"))
{
...
}
 
Back
Top