using System;
using System.Text.RegularExpressions;
public class Program
{
public static void Main()
var regex = @"^[\w\p{L}\p{M}\W-[`;<=>@\[\]_{|}¦\\]]{1,5}$";
var temp = Regex.IsMatch("TEST",regex);
if(temp)
Console.Write("match");
}
else Console.Write(" not match");