FYI, It is not duplicate please remove this tag.
I have tried packaging.version.Version
it does not work on 1.0.2h
and 192.168.0.3
.
Question
I am getting versions of different libraries/binaries in a list. And this list includes some garbage values of version along with correct one. I want to write a python code that can separate correct ones from the version list.
Please suggest a logic or python library which can do the following
Psuedo Code
Correct_verList = []
verList = ['2.6.36', '1.2.dfgdf', '1.sdfsdgsdsf', '3.0/0+3*/1,-/0/0,//O*K1', 'so.802', '5.0(side)', '6.2*20hm' , '192.168.0.222', '1.33', '0.97a', '1.0.2h', '2.4.2b3']
#Psuedo Code
for ver in verList:
if ver is the correct version:
Correct_verList.append(ver)
print(Correct_verList)
Expected Output
Correct_verList = [1.33, 0.97a, 2.6.36, 1.0.2h, 2.4.2b3]