Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Regex - Leading zeros
//C# 'Hello, world' //Rextester.Program.Main is the entry point for your code. Don't change it. using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var stringCollection=new string[]{"000003923892","000003923892","0003923892","003923892","03923892","3923892"}; foreach(var str in stringCollection) { Console.WriteLine(str + " is vaild string "+Regex.Match(str, @"\b(^([1-9]*|[0]{1}|[0]{2}|[0]{3})[1-9]{1}[0-9]*)\b", RegexOptions.IgnoreCase).Success); } } } }
run
|
edit
|
history
|
help
0
xddd
testing
Cotton Farm
LeftAndRightShiftStrings
Project Euler Problem 8
dfdfd
Project Euler Problem 10
1 -5 6 x1=3 x2=2
Program
give coins