using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace RegexDemo
{
class Program
{
static void Main(string[] args)
{
string i = "000000";
string m = "d";

Regex r = new Regex("^[0-9a-fA-F]{1,6}$");
Boolean iMatch;
ValidateNumber(i, r, out iMatch);
Boolean mMatch;
ValidateNumber(m,r,out mMatch);

Console.WriteLine(iMatch);
Console.WriteLine(mMatch);

Console.Read();
}

private static void ValidateNumber(string i, Regex r, out Boolean iMatch)
{
iMatch = r.IsMatch(i);


}
}
}

相关文章:

  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-16
  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案