rakesh
rakesh

Reputation: 3

Regular expressions in ASP.NET

I need a regex pattern to match this format ABC12345678:

it should start with ABC and should have preceding 8 numbers.

Upvotes: 0

Views: 97

Answers (3)

Stormenet
Stormenet

Reputation: 26468

txt2re is a great online resource for creating regex from a string. It also generates code samples in many languages including c#.

Upvotes: 0

Matthew Groves
Matthew Groves

Reputation: 26141

Whenever I have to write a regex (which I try to avoid as much as possible), I refer to this .NET regex cheat sheet.

Upvotes: 1

David Hedlund
David Hedlund

Reputation: 129792

The pattern you're looking for is

ABC\d{8}

Upvotes: 4

Related Questions