Javascript pattern matching a variable
I am struggling with working out a way to get a pattern match of a variable.  I have tried splitting things and doing an indexOf, using match, and a switch (true) statement, all with little success.  Any help would be appreciated!

                currentExports = 'sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com';
                badExportHosts = params.badExportHosts.split(':');
                for (badHost = 0; badHost < badExportHosts.length; badHost++) {
                        if (!currentExports.match(/badExportHosts[badHost]/g)) {
                                printf('Entry ' + badExportHosts[badHost] + ' was not found in ' + currentExports + '\n');
                        } else {
                                printf('Entry ' + badExportHosts[badHost] + ' was found in ' + currentExports + '\n');
                        }

If I enter into my form:

    badhost1.foo.com:badhost2.foo.com

I unfortunately get this result:

    Entry badhost1.foo.com was not found in sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com
    Entry badhost2.foo.com was not found in sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com

How can I get this to match?
Javascript pattern matching a variable
===

I am struggling with working out a way to get a pattern match of a variable.  I have tried splitting things and doing an indexOf, using match, and a switch (true) statement, all with little success.  Any help would be appreciated!

                currentExports = 'sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com';
                badExportHosts = params.badExportHosts.split(':');
                for (badHost = 0; badHost < badExportHosts.length; badHost++) {
                        if (!currentExports.match(/badExportHosts[badHost]/g)) {
                                printf('Entry ' + badExportHosts[badHost] + ' was not found in ' + currentExports + '\n');
                        } else {
                                printf('Entry ' + badExportHosts[badHost] + ' was found in ' + currentExports + '\n');
                        }

If I enter into my form:

    badhost1.foo.com:badhost2.foo.com

I unfortunately get this result:

    Entry badhost1.foo.com was not found in sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com
    Entry badhost2.foo.com was not found in sec=sys,rw=badhost1.foo.com:badhost2.foo.com,root=badhost1.foo.com:badhost2.foo.com

How can I get this to match?