Imagine capturing the input with a regex:
2.1_3_4
3.2.1
3.2.1.RELEASE
3.2.1.SNAPSHOT
The numbers and the dots are easy enough to get
([0-9\._]+)
But how do you capture that plus "RELEASE" or "SNAPHOT" or none of those?
I played around with the or operator to no avail...
([0-9\._]+RELEASE||SNAPSHOT) // no worky
btw, this is a nice regex tester: http://java-regex-tester.appspot.com/