I am using regex to get specyfic information from string. Value of string would look like:
\subpath1\subpath2\subpathn\4xxxx_2xxxx\filename.extension
//there can be many subpath and x is allways number, last part of path is allways number_number
//and it starts with 4 and last part is allways files with extension
//so I want to exclude path for example 4xxxx_xxxx/path/file.extension
So far using regex I came up wityh this construction (?<=\)(4[0-9])_([0-9]).?." but:
- Last part takes string as it is no matter if it is "sasas" or "sasas.sas"
- I do not know if it fills all my requirements
Any suggestions on this one?
(?<=[\\/])(4[0-9]*)_([0-9]*)/[^/]+\.\w+, add$at the end of the pattern if the match is always at the end of string.