So, I have an example path c:\folder1\folder2\folder3\file.txt I want regex to pull folder3\file.txt
I figured this would be everything after
1. a slash
2. followed by any number of non slash characters
3. followed by a slash
4. followed by any number of non slash characters
5. followed by a dot
5.1 that is not (eventually) followed by a slash
I've got most of it working
\\(?=[^\\]*(?=\\(?=[^\\]*(?=[\.]))))(.*)
unless I do this:
c:\folder1\folder2\fol.der3\file.txt (fol.der3 is the name of the directory)
or this
c:\folder1\folder2\folder3\file.txt\ (technically there is no file here)
So, I've got everything except step 5.1
So, I tried adding a negative lookahead after my dot seeking lookahead so it would exclude dots that have a slash somewhere after them:
(?=[\.][^\\]*(?![\\]))
but that didnt work
Any ideas?
Thanks Chris
[^\\]+\\[^\\]+$