Regex Expressions for all non alphanumeric symbols

If you want to match non-alphanumeric symbols then just use \W|_.

Regex pattern = new Regex(@"\W|_");

This will match anything except 0-9 and a-z. Information on the \W character class and others available here (c# Regex Cheet Sheet).

  • https://www.mikesdotnetting.com/article/46/c-regular-expressions-cheat-sheet

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)