Parsing pairs of a number or number range
Just answering this question since it is unanswered. Hope, it would help: 

Since your code is mainly about RegEx, which you'd most likely know that you can use this tool:


Your original RegEx based on an exact match method takes 265 steps and 1ms to match your 10 inputs, which is good. 

\s*(?:(\s*\d+\s*)|([\[\(]\s*\d+)\s*,\s*(\d+\s*[\]\)]))(?:,\s*(?:(\d+\s*)|\s*([\[\(]\d+)\s*,\s*(\d+\s*[\]\)])|(\s*&gt;\s*=\s*0\s*)))?\s*

Sometimes, exact match may not be necessary, not sure about your case or if you might have certain boundaries, but maybe you could use a faster RegEx with a lower number of iterations, maybe something similar to this, if you are not looking for an exact match, which is pretty fast and might match your 10 inputs with only 50 steps:  

^[0-9\,\[\]\(\) &gt;=]*$



The drawback of this method is that it is based on your input characters, i.e., numbers, [, ], (, ), ,, space and >=.