开发者

Regular expressions in ASP.NET

开发者 https://www.devze.com 2022-12-29 17:41 出处:网络
I need a regex pattern to match this format ABC12345678: it should start with ABC an开发者_开发技巧d should have preceding 8 numbers.The pattern you\'re looking for is

I need a regex pattern to match this format ABC12345678:

it should start with ABC an开发者_开发技巧d should have preceding 8 numbers.


The pattern you're looking for is

ABC\d{8}


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号