title: What regex syntax is supported by the =~ operator in bash?
body: <p>I discovered that I can use <strong><code>=~</code></strong>  operator instead of <strong><code>expr</code></strong> command in my 4.2.10(1) BASH.  It is much faster (within a command) than <code>expr</code> and this fact could be important inside in a loop with large repetition.</p>
  
  <p>I was able to use most of the meta characters of regular expression but not all.</p>
  
  <p>For example I can check a string matches exactly 3 repetitions of (one small letter, one digit, one dot):</p>
  
  <pre><code>[[ "b3.f5.h3." =~ ^([a-z][0-9]\.){3}$  ]] &amp;&amp; echo OK
  OK
  </code></pre>
  
  <p>and I can select matched substrings:</p>
  
  <pre><code>[[ "whatis12345thetwo765nmbers" =~ ^[a-z]+([0-9]+)[a-z]+([0-9]+) ]] &amp;&amp; \
  echo "The two number fields are: ${BASH_REMATCH[1]}  ${BASH_REMATCH[2]}"
  The two number fields are: 12345  765
  </code></pre>
  
  <p>But I would like to use more meta characters, such as the ones listed on <a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_01.html" rel="nofollow">this TLDP page</a>.</p>
  
  <p>I would especially like to match word boundaries: <strong><code>\b</code></strong>, <strong><code>\B</code></strong>, <strong><code>\&lt;</code></strong>, <strong><code>\&gt;</code></strong> .</p>
  
  <p>I tried to find an answer in the <em>Advanced Bash-Scripting Guide</em> (in Chapters 18 and 37) but was unsuccessful.</p>
  
  <p>Where can I find a detailed description of <strong><code>=~</code></strong> operator?</p>
  
  <p>At the moment I am interested only in BASH and not in gawk, sed, perl or other tools.</p>