PHPH | How to escape this long string with regex?
<p>Is there anyone who works with regexes in PHP and knows how to escape them well? I've tried writing my first regex today, and I'm failing to escape it correctly.</p>

<p>This is the string that I want to select (single string inside the input string):</p>

<pre><code>$(this).load(urlStr, data, function (response, innerstatus, xhr) {
                    status = innerstatus;
                    pb.hide();
                    sbmt_btn.show();
                    if (status == "error") {
                        var msg = "Sorry but there was an error: ";
                        $(this).html(msg + xhr.status + " " + xhr.statusText);
                    }
                    if ($('#NoMoreSearchForYou').get(0)) {
                        $('.ui-dialog-buttonset').hide();
                    }
                    else if ($('#MoreSearchForYou').length &gt; 0) {
                        $('.ui-dialog-buttonset').show();
                    }
                    else {
                        $('.ui-dialog-buttonset').hide();
                    }
                });
</code></pre>

<p>This is the regex string I used - tested in (see a live demo): <a href="http://regexr.com/3e0qv" rel="nofollow">http://regexr.com/3e0qv</a></p>

<pre><code>/\$\(this.+[\s\S]*hide\(\);[\s\S]{49};/m
</code></pre>

<p>Characters that are a part of the target string:</p>

<pre><code>), $, hide, (, ), ;
</code></pre>

<p>And an explanation to how they work would also help a lot.</p>

<p><code>preg_quote</code> and hand-made escaping didn't work for me.
I'd appreciate help a lot! I'm stuck on this.</p>