regex - C# regular expression for the string format. Examples: "400-900", "499-999,0-99" -
regex - C# regular expression for the string format. Examples: "400-900", "499-999,0-99" -
this question has reply here:
regex optional groups? 3 answersthe regular expression: "^\d{1,3}-\d{1,3}$" works onetime pattern i.e. "400-900" regular look ? not working repetition i.e. "^\d{1,3}-\d{1,3}$?" not identifying string "499-999,0-99".
any suggestions, regular look be?
change pattern below match strings has repetation.
@"^\d{1,3}-\d{1,3}(?:,\d{1,3}-\d{1,3})?$"
demo
c# regex
Comments
Post a Comment