Need a regex that will match either of {m,n}|{m,}|{,n}|{n} (where m and n are integer numbers) with arbitrary number of spaces in between symbols in the beginning of the line. I came up with this:
^({\s*\d+\s*,\s*\d+\s*}|{\s*,\s*\d+\s*}|{\s*\d+\s*,\s*}|{\s*\d+\s*})
While it certainly works, I was curious if there is a way to make it shorter. Thanks for input.
UPDATE: Mark proposed an excellent solution: ^\{(\s*\d+\s*(,(\s*\d+\s*)?)?|,\s*\d+\s*)\}