title: unix regex: match from end of string until white space character
body: <p>The git command:</p>
  
  <pre><code>git diff-tree --no-commit-id --name-status -r &lt;commit hash&gt;
  </code></pre>
  
  <p>generates a list that looks kinda like this:</p>
  
  <pre><code>D    path/to/deleted/file.txt
  A    path/to/added/file.txt
  A    path/to/added/file.asd
  M    path/to/modified/file.txt
  </code></pre>
  
  <p>I want to grep out only the added and modified (A or M) txt files and their paths. I know I can do like this:</p>
  
  <pre><code>grep -v "^D"
  </code></pre>
  
  <p>to not include the deleted files.</p>
  
  <p>and</p>
  
  <pre><code>grep -o "\w*.txt$"
  </code></pre>
  
  <p>to only get the txt files. But this command does not give me the path to the files. Since <code>\w</code> only matches the word. Is there any other wildcard that will match until the whitespace character (so that it removes the A/M with corresponding whitespace)? </p>