title: How can i solve invalid regular expressions?
body: <p>This is error patch:</p>
  
  <p><a href="https://i.stack.imgur.com/eSBle.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eSBle.png" alt="enter image description here"></a></p>
  
  <p>And here is my code for hide modal in iphone device</p>
  
  <pre><code>$(document).ready(function(){
      var modal = $('.myModal', window.top.document); // Works
      modal.on('show.bs.modal', function(e) {
        var width = $(window).width(); 
        var testdevice =  /iPhone/i.test(navigator.userAgent);
        if(testdevice) {
          $(this).modal('toggle');
        }
      });
    });
  </code></pre>