code_junkie

RegEx to tell if a string does not contain a specific character

Nov 11th, 2011
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. Regex.IsMatch("103","[^0]")
  2.  
  3. Regex.IsMatch("103&","[^&]")
  4.  
  5. Regex.IsMatch("103","^[^0]*$")
  6.  
  7. Not Regex.IsMatch("103", "0")
  8.  
  9. Not Regex.IsMatch("103&", "&")
Add Comment
Please, Sign In to add comment