title: Why does regex show a match even when one of the characters isn't there in the string?
body: <p>when running this:</p>
  
  <pre><code>echo "abcd/fgh/ijkl" | sed 's|[^/]*/\(.*\)|\1|'
  </code></pre>
  
  <p>the output as expected is </p>
  
  <pre><code>fgh/ijkl
  </code></pre>
  
  <p>but when running this:</p>
  
  <pre><code>echo "abcd" | sed 's|[^/]*/\(.*\)|\1|'
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>abcd
  </code></pre>
  
  <p>instead of the expected null string. Why does this match even when there is no <code>/</code> in the string. Is this due to the greediness of the regex. How do I make it work correctly?</p>