title: Make sure every occurence of char is followed by another char in bash
body: <p>I have a pretty  simple code that looks like this:</p>
  
  <pre><code>txt="hard==2.3.3 soft==2.1.1 weak rep=2.1"
  
  if [[ $txt =~ ([^\=]\=\=[^\=])* ]]; then
      echo "Good"
  else
      echo "Bad"
  
  # Output is "Bad"
  </code></pre>
  
  <p>I want the <code>if</code> statement to be true only when there is <code>==</code>, so if there is a solo <code>=</code> or if there's a <code>===</code> it's false. So basically, if there is a <code>=</code>, there has to be a second one right after. If there is no <code>=</code> (like with <code>weak</code>) then it's fine.</p>
  
  <p>The problem with my code is that as soon as there's at least one <code>==</code> in txt, the <code>if</code> will be true. Is there a way to make sure that there's a second <code>=</code> for every occurrence? Thanks</p>