title: Javascript .search() issue Uncaught SyntaxError: Invalid regular expression: /*/: Nothing to repeat
body: <p>Can anyone explain this bug for me , what we have here is : </p>
  
  <pre><code>if(statements[bracket].firsthalf.search(math_operators[j])!=-1)
  </code></pre>
  
  <p>where <code>statements[bracket].firsthalf = "2*a"</code> , <code>math_operators[j]="*"</code> , the console shows the following error:</p>
  
  <blockquote>
    <p>Uncaught SyntaxError: Invalid regular expression: /*/: Nothing to
    repeat</p>
  </blockquote>
  
  <p>any idea why would it show such error ?</p>
  
  <p><img src="https://i.stack.imgur.com/tyu65.png" alt="enter image description here"></p>