I'm looking for a regex to achieve the following:
When my input is root:Folder1:fname I want to get fname
and when the input string is root:Folder1:'fname' to get again fname (no quotes!).
For the former [^:?]*$ seems to get the job done but I cannot find a single regex to match both cases.
Is it possible to do it with a single regex? Tried to achieve it with conditional regex but I couldn't make it.
Any other tip/solution is welcome.
Thank you.
edit: The format of the paths is not fixed, quotes might appear elsewhere (e.g. root:'Folder with spaces1':fname or root:'Folder with spaces1':'fname'). The solution I guess is to search backwards as the filename we want to capture is always after the last colon.