Contains Numbers by regex - CSharp System.Text.RegularExpressions

CSharp examples for System.Text.RegularExpressions:Match Number

Description

Contains Numbers by regex

Demo Code


using System.Security.Cryptography;
using System.IO;/*from  ww  w.  j  a v  a 2 s.co m*/
using System;

public class Main{
        private static bool ContainsNumbers(string value)
      {
         System.Text.RegularExpressions.Regex regEx = new System.Text.RegularExpressions.Regex(@"[0-9]", System.Text.RegularExpressions.RegexOptions.Singleline);
         return regEx.IsMatch(value);
      }
}

Related Tutorials