title: Regex, only match with strings that contain one occurence of certain characters
body: <p>I have the following regular expression:</p>
  
  <pre><code>^[-]?([+]?[\d]+[-+*/]?)+$
  </code></pre>
  
  <p>My objective is to match strings that contain arithmetic expressions and integers. Which it is successful in, except one case. When it comes to equals signs. I only want this expression to match strings that contain at most one equals sign. Which would mean that it would match</p>
  
  <blockquote>
    <p>7=7</p>
  </blockquote>
  
  <p>but not</p>
  
  <blockquote>
    <p>7=7=7</p>
  </blockquote>
  
  <p>since the second string has two occurrences of the equals sign. </p>
  
  <p>I tried using curly braces {} and I think I need something like</p>
  
  <pre><code>={0,1}
  </code></pre>
  
  <p>which would match with strings that have exactly one or no occurrencces of "=". But I do unfortunately not know how to incorporate it in my regex.</p>