the expression is used to validate userinput from a textfield in a asp.net website
it should validate a username: roules for the username is that starts with pc or lc, and afterthat its 4 to 8 numbers like:
pc12345678 or lc12345678
can any of you create a regular expression for me? :)

VulpesRank #55 · 29.2K reputationPosted Sep 23, 2013, 4:24 AM EDT
string regExp = @"^(p|l)c\d{4,8}$";
or, if upper case as well as lower case letters are allowed:
string regExp = @"^(?i)(p|l)c\d{4,8}$";
Sanjay KumarRank #561 · 4.3K reputationPosted Sep 23, 2013, 3:22 AM EDT
try this
http://stackoverflow.com/questions/576196/regular-expression-allow-letters-numbers-and-spaces-with-at-least-one-letter
http://stackoverflow.com/questions/1649435/regular-expression-to-limit-number-of-characters-to-10
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 23, 2013, 3:51 AM EDT
try this. any problem reply
^(lc|pc|PC|LC)\d{4,8}$
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 23, 2013, 4:55 AM EDT
hi,
I have one question case of pc or lc is matter?
if yes then agree with Vulpe..
other wise try
^(p|l|P|L)(c|C)\d{4,8}$
hope this will help you.
Puneet GuptaRank #2,006 · 724 reputationPosted Sep 23, 2013, 5:08 AM EDT
jesper89 reputationPosted Sep 24, 2013, 2:27 AM EDT