regex to extract a string from begin/end pattern -


i extract string "1_0" input string "some_file_name_v_1_0.xml"

what regex should use ?

i think of extracting string 1_0 between : - begin pattern "_v_" - end pattern ".xml" 

toto_v_2_0.xml in input should return 2_0

thanks help,

regards,

try using following pattern:

^.*?v_(.*)\.xml$ 

and check first capture group version string.


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -