I'm trying to create a regex pattern to part numbers from file paths like this
\\D6-DC\Users$\name\Profile\Desktop\New folder\XXX-XX-XX-XXX OP1 RAN.NC
Where XXX-XX-XX-XXX
is the string i want to extract, the number after OP will sometimes change, and RAN may not always be present. File locations also change.
any help would be greatly appreciated
I'm not very good with regex and have spent almost 2 hours trying to figure this out yesterday. The closest I got was (?:.(?!\\))+$
which is capturing the end of the path okay, but I can't for the life of me figure out how to narrow this down to only outputting the specific string.