How to validate a 5 characters input of textbox that the first 3 characters to letters only and the last 2 characters to numbers c# [closed]

You can use RegEx [A-Za-z]{3} – Matches 3 alpha [0-9]{2} – Matches 2 numbers

Test your inputs with given regex online

                Regex temp = new Regex("^[A-Za-z]{3}[0-9]{2}$");
                string yourVal = "asd12";

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top