title: Check if 2 substrings are present in string bash
body: <p>I want to check if the letters "d" and "y" are present in string <code>str</code> at the same time in any order.</p>
  
  <p>If I try OR operator <code>|</code> within the regex <code>(d|y)</code> evaluates to true if "d" or "y" are in string, but if use the AND operador <code>&amp;</code> doesn´t work and evaluates to false even
  both letters exist in string.</p>
  
  <p>What would be the correct way to check this?</p>
  
  <p>This is what I tested so far</p>
  
  <pre><code>str="good day"
  
  if [[ $str =~ (d|y) ]] # This works for OR operator
  if [[ $str =~ (d&amp;y) ]] # doesn´t work for AND operator
      then 
          echo "yes"
  else 
      echo "no"
  fi
  </code></pre>
  
  <p>Thanks in advance.</p>