Python Forum

Full Version: extract version in a string
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I need help to extract only version in the following string.

str="psutil-5.4.5-cp27-none-win32.whl"

output should be : 5.4.5

Appreciate help on this.

Thx,
Lokesh
What have you tried?

Never use str as name or you will be unpleasantly surprised.