title: Regex to find directory in text
body: <p>How do I find a path and file name in a block of text?</p>
  
  <p>Before you mark this as duplicate I know questions about file paths exist</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/169008/regex-for-parsing-directory-and-filename">Regex for parsing directory and filename</a> (does not match in a paragraph.)</li>
  <li><a href="https://stackoverflow.com/questions/20056104/regex-that-matches-directory-path-excluding-filepath">Regex that matches directory path excluding filepath</a> (this one just match the file name, answer doesn't work for paragraphs, and doesn't address <code>.</code> or <code></code>spaces)</li>
  <li><a href="https://stackoverflow.com/questions/4489582/java-regular-expression-to-match-file-path">java regular expression to match file path</a> (doesn't address <code>.</code> or <code></code>spaces)</li>
  <li><a href="https://stackoverflow.com/questions/9363145/regex-for-extracting-filename-from-path">Regex for extracting filename from path</a> (doesn't address being in a paragraph)</li>
  </ul>
  
  <p>For example</p>
  
  <pre><code>In file included from /some/directoy/3.33A.37.2/something else/dogs.txt,
                   from /some/directoy/something else/dogs.txt,
                   from /some/directoyr/3.33A.37.2/something else/dogs.txt,
                   from /var/log/xyz/10032008.log,
                   from /var/log/xyz/test.c:29:
  Solution:
  please the file something.h has to be alone without others include, it has to be present in release letter, 
  in order to be included in /var/log/xyz/test.c and /var/log/xyz/test.h automatically
  Other Note: 
  The file something.c must contain the somethinge.h and not the ecpfmbsd.h because it doesn't contain C operative code.. everything good.. 
  </code></pre>
  
  <p>The following are the ideal matches:</p>
  
  <pre><code>/some/directoy/3.33A.37.2/something else/dogs.txt
  /some/directoy/something else/dogs.txt
  /some/directoyr/3.33A.37.2/something else/dogs.txt
  /var/log/xyz/10032008.log
  /var/log/xyz/test.c:29 (this is a tricky one, ok with out it)
  /var/log/xyz/test.c
  /var/log/xyz/test.h
  </code></pre>
  
  <p>Going further what if I find an answer how can I change it to work with <code>\</code> instead of <code>/</code> directories</p>