title: Bash String Format Comparison with Wildcards
body: <p>I am fairly new to bash scripting and was trying to echo only lines that match a specific formatting. I have this code so far:</p>
  <pre><code>LINE=1
  while read -r CURRENT_LINE
      do 
          if [[ $CURRENT_LINE == ??-?-??? ]]
          then
              echo &quot;$LINE: $CURRENT_LINE&quot;
          fi    
          ((LINE++))
  done &lt; &quot;./new-1.txt&quot;
  </code></pre>
  <p>The text file contains number sequences on each line that match the following format: &quot;12-3-456&quot;, but also contains sequences that are in different formats as well, such as &quot;123-89203-9420&quot; or &quot;123-456-7890&quot;. I can't quite understand why the if statement inside the while loop does not result to True on lines that match the formatting. I've tried using the * as well, but using it gives me incorrect results.</p>
  <p>Here are the contents of the text file new-1.txt. I want the script to output &quot;Line 1: 11-1-111&quot;, but it doesn't output anything.</p>
  <pre><code>11-1-111
  222-22-2222
  333-33-3333
  444-444-4444
  555-555-5555
  </code></pre>