title: Extract filelocation from a sentence
body: <p>Input is being read from console and stored in string, trying to make pattern to get file path along with filename.extension
  if not than just filename.extension (without path also works)</p>
  
  <p>Sample input string:</p>
  
  <pre><code>[blah]: Destination folder is: part1/part2/part3/
  [blah]: SP status: 
    .....
  [blah]: moving fileNameNeeded.Extension to part1/part2/part3/fileNameNeeded.Extension
  [blah]: moving done...
  DC data collected at part1/part2/part3/fileNameNeeded.Extension
  [blah]: Elapsed time 
  </code></pre>
  
  <p>Pattern tried: </p>
  
  <pre><code>Pattern regex = Pattern.compile("[^/.]+(?=\\.*?tar$)");
  </code></pre>
  
  <p>also tried:</p>
  
  <pre><code>Pattern regex = Pattern.compile("\\bDC data collected at.*?tar");
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>DC data collected at part1/part2/part3/fileNameNeeded.Extension
  </code></pre>
  
  <p>but getting additional output as well (don't want to use string split).</p>
  
  <p>I did checked post: <a href="https://stackoverflow.com/questions/24541500/extract-part-of-a-string-from-a-url-java-regex">Extract part of a string from a URL - Java Regex</a> but I am not very familiar with Regex.</p>
  
  <p>Any help/suggestion appreciated</p>