title: Bash script pattern matching
body: <p>I need a to find patterns that are 6 digits and the first 3 digits are specific digits, but the remaining 3 digits will be any digit.
  For example, 6 digit strings starting with 123 followed by any 3 digits.</p>
  
  <pre><code>var1="abc,123111,"
  var2="abcdefg,123222,"
  var3="xyzabc,987111,"
  
  if [[ $var1 == *",123ddd,"* ]] ; then echo "Pattern matched"; fi
  </code></pre>
  
  <p>Where ddd are any digits.  var1 and var2 would match the pattern but var 3 would not.  I can't seem to get it just right.</p>