I found some threads about extracting version number from a string on here but none that does exactly what I want.
How can I filter out the following version numbers from a string with javascript/regex?
Title_v1_1.00.mov filters 1
v.1.0.1-Title.mp3 filters 1.0.1
Title V.3.4A. filters 3.4A
V3.0.4b mix v2 filters 3.0.4b
So look for the first occurrence of: "v" or "v." followed by a digit, followed by digits, letters or dots until either the end of the string or until a whitepace occurs or until a dot (.) occurs with no digit after it.
v\.?(\d+(?=\S)(?:\.\d+[a-z]?)*)see demoV3.0.4b mix v2it should also matchv2?Title v1 V3.0.4b mix v2where it should match just1for "v1". It seems like you need something after the first digit for it to match, which I realize I may have been misleading in the original post.^. See this demo Should the[a-z]only be after the last digit like3.4Aor could it also be3.4A.5B