Javascript Matching a string to an Array of Regex Expressions

If you want to check if a string matches any of an array of regexes and return true in the first encountered match, do the following:

var regexes = [/a/,/b/,/c/];
for(var i = 0; i<regexes.length; i++) {
  var regex = regexes[i];
  if( str.match( x[i] ) ) {
    console.log("regex:", regex, "matching: true");
  } else {
    console.log("regex:", regex, "matching: false");
  }
}