update the version detection to use better regex matching for version
and add more test cases