Javascript Match on parentheses inside the string
<p><em>How do I do a .match on a string that has parentheses in the string?
String1.match("How do I match this (MATCH ME)");</em></p>

<hr>

<p>None of the answers are getting me what I want. I'm probably just doing it wrong. I tried to make my question basic and I think doing that asked my question wrong. This is the statement I am tring to fix:</p>

<pre><code>$('[id$=txtEntry3]').focus(function () {

    if (!DropdownList.toString().match($('[id$=txtEntry2]').val()) || $('[id$=txtEntry2]').val().length &lt; 5) {
        $('[id$=txtEntry2]').select();

        ErrorMessageIn("The Ingredient number you entered is not valid.");
        return;
    }
    ErrorMessageOut();
});
</code></pre>

<p>This works correctly the problem I am running into is when it tries to match a entry from "txtEntry2" that has "()" in it.</p>

<hr>

<hr>

<p>Well it's kinda broken but it works for what I need it to do. This is what I did to fix my problem:</p>

<pre><code>$('[id$=txtEntry3]').focus(function () {

        if (!StripParentheses(DropdownList).match(StripParentheses($('[id$=txtEntry2]').val())) || $('[id$=txtEntry2]').val().length &lt; 5) {
            $('[id$=txtEntry2]').select();
            if (!$('[id$=txtEntry2]').val() == "") {
                ErrorMessageIn("The Ingredient number you entered is not valid.");
            }
            return;
        }
        ErrorMessageOut();
    });

function StripParentheses(String){
    x = String.toString().replace(/\(/g, '');
    x = x.toString().replace(/\)/g, '');
    return x;
}
</code></pre>
