Created
December 16, 2020 17:33
-
-
Save simonreeves/842829405c47db653736b5f8ad519e03 to your computer and use it in GitHub Desktop.
regex find version #python #version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find 3 digit string version with prefix 'v' - but dont incliude the v in the result | |
# v### - with postive lookbehind for the v | |
filename = '/mydir_v012/myfile_v012.1001.exr' | |
# wil' return list of all found results | |
find_versions = re.findall('(?<=v)\d{3}', filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment