I'm looking for an easy way to turn this string:
(java || javascript) && vbscript
Into this string:
(str.search('java') || str.search('javascript')) && str.search('vbscript')
ie replace each word in the string with str.search('" + word + "')
I've looked at mystring.match(/[-\w]+/g);
which will pull any words out into an array (but not their position)