title: Extract substring after a character
body: <p>I'm trying to extract substring after the last period (dot).
  examples below.</p>
  
  <ul>
  <li><code>echo "filename..txt"</code>  should return "txt"</li>
  <li><code>echo "filename.txt."</code>  should return ""</li>
  <li><code>echo "filename"</code>       should return ""</li>
  <li><code>echo "filename.xml"</code>   should return "xml"</li>
  </ul>
  
  <p>I tried below. but works only if the character(dot) exists once. But my filename may have (dot) for 0 or more times.</p>
  
  <pre><code>echo "filename.txt" | cut -d "." -f2
  </code></pre>