title: RegEx expression to select folder path of a file type
body: <p>I am looking to make a Regex expression to find places where pdf files are referenced, and select their folder path.</p>
  
  <p>For example for the expression <code>"http://folders/../file.pdf"</code> it should select
  <code>"http://folders/../</code></p>
  
  <p>The issue is that I only want it to select pdf files and escape if it hits a second quotation mark (<code>"http://folders/other"</code> doesn't have anything get selected)</p>
  
  <p>I currently have two regex expressions that each do half of what I want:</p>
  
  <p><code>"(.[^"]*?)(?=\.pdf")</code> selects all the paths that end with a pdf, but includes the filename.</p>
  
  <p><code>"(.[^"]*[\/])</code> properly grabs just the folder path, but does it for all links.</p>
  
  <p>Is there a way I can get a regex expression that selects just the folder path only when the file ends with a .pdf extension?</p>