title: Extract pattern from a string
body: <p>In bash script, what is the easy way to extract a text pattern from a string?</p>
  
  <p>For example, I want to extract <code>X</code> followed by 2 digits in the end of the string?</p>