title: How to compare text with regex which is in variable?
body: <p>I have the following in input.txt:</p>
  
  <pre><code>EA06\\?\.LFRFLB\\?\..*
  </code></pre>
  
  <p>I want to know if this pattern match with the following string:</p>
  
  <pre><code>EA06.LFRFLB.SHELLO
  </code></pre>
  
  <p>Then I coded:</p>
  
  <pre><code>MY_STRING="EA06.LFRFLB.SHELLO"
  REGEX=$(cat input.txt) # EA06\\?\.LFRFLB\\?\..*
  
  if [[ "${MY_STRING}" =~ "${REGEX}" ]]; then
    echo "FOUND"
  else
   echo "NOT FOUND"
  fi
  
  if [[ "${MY_STRING}" =~ EA06\\?\.LFRFLB\\?\..* ]]; then
    echo "FOUND"
  else
   echo "NOT FOUND"
  fi
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>NOT FOUND
  FOUND
  </code></pre>
  
  <p>Whats is going wrong here? Why the first if does not match correctly? What is the best way to solve it?</p>