CSharp examples for System.Text.RegularExpressions:Match Number
Is Numeric via Regex
using System.Threading.Tasks; using System.Text.RegularExpressions; using System.Text; using System.Reflection; using System.Linq; using System.ComponentModel; using System.Collections.Generic; using System;//from w w w . j a va2 s . c om public class Main{ public static bool IsNumeric(string value) { const string pattern = @"^\d+$"; return Regex.IsMatch(value, pattern); } }