samedi 21 novembre 2020

Deny these Regular Expressions !@#$%^&*(),.<>? C# [closed]

Hello im a new programmer and i have a project written in C#. here's my code:

 else if (!Regex.IsMatch(textBox1.Text, @"^[" "][!][@][#][$]['^'][&][*][()][,][>][.][,][?][/]"))
            {
                MessageBox.Show("Invalid name!\nthe name can't have these Regular Expressions:\n !@#$%^&*(),.");
            }

I want the textbox do not accept a name with those Regular expresions, and also i want the name do not start with space. Can someone help me?

Aucun commentaire:

Enregistrer un commentaire