编程语言
首页 > 编程语言> > c# 车牌号提取

c# 车牌号提取

作者:互联网

 

            string carNumber = "我的车冀R445541是多少";

            

            MatchCollection mcCarNumber = Regex.Matches(carNumber, @"([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1})");
            foreach (Match match in mcCarNumber)
            {
                var result = match.Value;
                Console.WriteLine(result);
            }
            Console.ReadLine();

 

标签:carNumber,Console,mcCarNumber,c#,车牌号,result,提取,Z0,match
来源: https://www.cnblogs.com/wjx-blog/p/15381020.html