I need to extract just the filename (no file extension) from the following path....
\\\\my-local-server\\path\\to\\this_file may_contain-any&character.pdf<
Here a solution to extract the file name without the dot of the extension. I begin with the answer from @Hammad Khan and add the dot in the search character. So, dots can be part of the file name:
[ \w-.]+\.
Then use the regex look ahead(?= ) for a dot, so it will stop the search at the last dot (the dot before the extension), and the dot will not appears in the result:
[ \w-.]+(?=[.])
reorder, it's not necessary but look better:
[\w-. ]+(?=[.])