I have a functionality to extract the file name from a path.
I am currently using the regex: ^.+\([^.]+).[^.]+$ to extract the file name. It is working fine when the file name has no dot (’.’ or period).
Eg 1: Data\Downloads\Taxation.png
output of Group(1)= Taxation
But when the file name contains multiple dots the above regex is failing:
Eg 2: Data\Downloads\Taxation.1.png.
The expected outcome was Taxation.1, but the current regex is failing.
Please note that there is no upper limit on the number of dots that can be present within the file name.
Would be a great help if some one can share a regex, that could work when there is zero dots or multiple dots present in a file name.
Thank you in advance.