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 answers

the 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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -