Not sure why I'm having so much trouble with this, but I'd like for someone to help me with pattern matching this particular format:
- It's for the name of a document, which will have 4 sections. I want to grab the last section of the name. Each section will always be separated by a "space dash space" like this: " - ".
- The "space dash space" will always occur 3 times in the name. So a sample name would be like this: "Test - Annual Budget - 2015/1/29 - Spreadsheet".
- The first three sections of the name might have anything in there, including alphanumeric, spaces, and symbols. It can also have a dash, but there will be no spaces with the dash. An example would be "Test - Semi-Annual Budget - 2015/1/29 - Spreadsheet".
- I want my pattern matching to disregard the first three sections, and extract the last section, which is after the third "space dash space". So in the above example, the word "Spreadsheet" would be extracted.
- Originally I was using the format .* - .* - .* - (.*)
- Here's the problem: that last section can literally have anything in it, including letters, numbers, symbols, spaces, and even another "space dash space." So if we have the example "Test - Semi-Annual Budget - 2015/1/29 - Spreadsheet - New Document", I would want to extract the section in bold, as all of that occurs after the third "space dash space".
- But instead, it will only extract "New Document". It is pulling any text after the last "space dash space". I want it to grab everything after the third "space dash space", including any additional "space dash spaces". (I hope that makes sense to everyone).
I have included a screenshot of what I have so far and the behavior described above. I know there must be a way to accomplish this. Please help. Thanks.