title: how to match hostname machine
body: <p>please advice how to match the following <code>hostname</code></p>
  
  <p>machine <code>hostname</code> Should be according to the following rule</p>
  
  <pre><code>&lt;a-z word &gt;&lt;number&gt;&lt;a-z character/s&gt;
  </code></pre>
  
  <p>real example</p>
  
  <pre><code>star1a
  linux25as
  machine2b
  linux5a
  solaris300C
  unix9c
  </code></pre>
  
  <p>please advice how to machine these  <code>hostname</code> with grep </p>
  
  <p>I have for now this syntax</p>
  
  <pre><code>hostname | grep -c '[a-z][1-2][a-z]'
  </code></pre>
  
  <p>but these syntax not work on all my examples </p>
  
  <p>on solaris the option egrep -E not works</p>
  
  <pre><code>hostname | grep -E '\b[a-z]+[0-9][a-z]+'
  grep: illegal option -- E
  Usage: grep -hblcnsviw pattern file . . .
  Broken Pipe
  </code></pre>
  
  <p>try the second option ( on solaris machine ):</p>
  
  <pre><code>hostname
  swu2a
  hostname | grep "^[a-z]\+[0-9][a-z]\+$"
  </code></pre>
  
  <p>not matched!!!</p>
  
  <p>I also try this:</p>
  
  <pre><code>hostname
  swu2a
  hostname | grep '[a-z]\+[0-9]\+[a-zA-Z]\+'
  </code></pre>
  
  <p>NOT MATCHED!!!</p>