Improve upper-bound detection.

- Allow for empty upper bounds
- Allow for upper bounds contion . verions ( i.e. 1.4, or 2.0.0 )
- Exposed internal regex and added basic tests