- .NET Framework : 4.7.2
 - IDE : Visual Studio Community 2019
 - OS : Windows 10 x64
 - typesetting : Markdown
 
code
using System;
using System.Text.RegularExpressions;
namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // 0-9数字出现了一次或者多次
            string regularExpression = @"[0-9]+";
            Regex rg = new Regex(regularExpression);
            string[] contents = { "@@@", "aaaa", "a3bb33345", "a321b3" };
            for (int i = 0; i < contents.Length; i++)
            {
                if (rg.IsMatch(contents[i]))
                {
                    Console.WriteLine(contents[i] + "成功");
                }
                else
                {
                    Console.WriteLine(contents[i] + "不成功");
                }
            }
            Console.ReadKey();
        }
    }
}
result
@@@不成功
aaaa不成功
a3bb33345成功
a321b3成功
resource
- [文档] docs.microsoft.com/zh-cn/dotnet/csharp
 - [规范] github.com/dotnet/docs/tree/master/docs/standard/design-guidelines
 - [平台] regexr.com
 - [文档] www.runoob.com/regexp/regexp-tutorial.html
 - [源码] referencesource.microsoft.com
 - [ IDE ] visualstudio.microsoft.com/zh-hans
 - [.NET Core] dotnet.github.io
 
感恩曾经帮助过 心少朴 的人。
 C#优秀,值得学习。正则表达式要大胆学习,小心使用(个人建议)。
 Console,WinForm,WPF,ASP.NET,Azure WebJob,WCF,Unity3d,UWP可以适当地了解。
注:此文是自学笔记所生,质量中下等,故要三思而后行。新手到此,不可照搬,应先研究其理象数,待能变通之时,自然跳出深坑。
![在这里插入图片描述 C#-正则基础 [0-9]+ 匹配一个或者多个数字_Express](https://file.cfanz.cn/uploads/jpeg/2023/04/20/10/c862CC721e.jpeg)
                










