title: Pattern for multiplicity in python
body: <p>In my Python application I have the concept of multiplicity stored as a tuple in a class. This multiplicity has kind of the same meaning as it is in UML syntax, so it will say how many objects of that class may be instantiated.</p>
  
  <p>To set its values, I have a method <code>myClass.setMethod(multiplicity)</code>, where multiplicity is a tuple and inside this method I would like to verify if the user has provided correct lower and upper values for the tuple.</p>
  
  <p>Valid examples:</p>
  
  <pre><code>(1,1)
  (0,1)
  (1,6)
  (0,*)
  (0,-1)
  </code></pre>
  
  <p>Invalid examples:</p>
  
  <pre><code>(-1,3)
  (0,-2)
  (2,1)
  </code></pre>
  
  <p>Basically I need to check if all the 3 following statements are respected:</p>
  
  <ul>
  <li>The lower value is an integer number >=0</li>
  <li>The upper value is an integer number >= -1 or the character *.</li>
  <li>lower is &lt;= upper
  (Leaving the possibility to specify this case as well(0,0))</li>
  </ul>
  
  <p>I was thinking that a possible way would be using regular expressions.
  Can anyone help me?</p>