title: escaping question mark in regex javascript
body: <p>This is a simple question I think.</p>
  
  <p>I am trying to search for the occurrence of a string in another string using regex in JavaScript like so:</p>
  
  <pre><code> var content ="Hi, I like your Apartment. Could we schedule a viewing? My phone number is: ";
  
   var gent = new RegExp("I like your Apartment. Could we schedule a viewing? My", "g");
  
   if(content.search(gent) != -1){   
       alert('worked');     
   }          
  </code></pre>
  
  <p>This doesn't work because of the <code>?</code> character....I tried escaping it with <code>\</code>, but that doesn't work either. Is there another way to use <code>?</code> literally instead of as a special character?</p>