title: Correct way to filter results with if statement in bash loop
body: <p>I'm trying to work out a loop that will let me ignore some matches. So far I have:</p>
  
  <pre><code>for d in /home/chambres/web/x.org/public_html/2018/js/lib/*.js ;  do
      if [[ $d =~ /*.min.js/ ]];
      then
          echo "ignore $d"
      else
          filename="${d##*/}"
          echo "$d"
          #echo "$filename"
      fi
  
  done
  </code></pre>
  
  <p>However when I run it, they still seem to get included. What am I doing wrong?</p>
  
  <pre><code>/home/chambres/web/x.org/public_html/2018/js/lib/underscore.js.min.js
  /home/chambres/web/x.org/public_html/2018/js/lib/tiny-slider.js
  /home/chambres/web/x.org/public_html/2018/js/lib/tiny-slider.js.min.js
  /home/chambres/web/x.org/public_html/2018/js/lib/underscore.js
  </code></pre>
  
  <p>BTW I'm a bit of a newbie with bash, so please be kind ;) </p>