CSharp examples for System.Text.RegularExpressions:Match Number
Is Numeric by Regex
using System.Text.RegularExpressions; using System.Text; using System.Linq; using System.IO;//from w w w. j a v a 2s. c o m using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static bool IsNumeric(this string value) { var regex = new Regex(@"^\-?[0-9]+$"); return regex.IsMatch(value); } }