16,001,998 members
See more:
Hi Friends good morning

i want regular expression for this
this is my requirement

AP10B1234(two alphabets two digits 4 digits)

small correction plz dontmind

two alphabets is mandatory next 1 or 2 digits next 1 0r 2 alphabets next 1 to 4 digits
Posted
Updated 8-Sep-11 20:13pm
v3

## Solution 2

^[A-Z]{2}([ \-])[0-9]{2}[ ,][A-Z0-9]{1,2}[A-Z]\1[0-9]{4}\$

## Solution 1

`(?<vnumber>[a-zA-Z][a-zA-Z]\d\d[a-zA-Z]{1,2}\d\d\d\d)`

Matches will be returned in the `vnumber` variable

v4
hitech_s 9-Sep-11 2:00am
small correction plz dontmind

two alphabets is mandatory next 1 or 2 digits next 1 0r 2 alphabets next 1 to 4 digits
Mehdi Gholam 9-Sep-11 2:35am
Fixed, the < > tags were giving trouble.
Member 12764429 6-Oct-16 1:06am

## Solution 3

String reg1 = @"^[a-z]{2}[0-9]{2}[a-z]{1,2}[0-9]{4}\$";
Regex regexVeh = new Regex(reg1, RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.CultureInvariant | RegexOptions.Compiled);
Match match = regexVeh.Match(txtVehNo.Text.Trim());
if (match.Success)
{
MessageBox.Show(match.Value);
}
else
{
MessageBox.Show("Enter Valid VechicleNo" + Environment.NewLine + "(Ex: TN46AM1234)", "Transport Details");
}

Above code will help you to validate the Vehicle numbers like TN23FT3456, TN54R3443

CHill60 29-Jul-15 9:28am
Post was answered over 3 years ago. OP asked for the regex not the code, and does not mention c# at all. I also don't think ignore case is appropriate

## Solution 4

Validators.pattern('[A-Z]{2}[ -][0-9]{1,2}(?: [A-Z])?(?: [A-Z]*)? [0-9]{4}')

OriginalGriff 1-Jun-22 3:14am
While I applaud your urge to help people, it's a good idea to stick to new questions, rather than 11 year old ones. After that amount of time, it's unlikely that the original poster is at all interested in the problem any more!
Answering old questions can be seen as rep-point hunting, which is a form of site abuse. The more trigger happy amongst us will start the process of banning you from the site if you aren't careful. Stick to new questions and you'll be fine.