I'm a little stuck trying to figure out the correct regular expression syntax for the following:

consider this input :

`var input = "sdkfjhd board hjh alabama jdjd bat";` 

to be matched against 

`var arr = ["Board of Pre University Education", "Alabama Autonomous Board", "Batman Gotham Bruce", "Superman KalEl Clark", "Board of Whatever"];`

```
var split_input = input.split(' ').join(")|^(");
var re = new RegExp("^(" + split_input + ")", "i"); // /^(sdkfjhd)|^(board)|^(hjh)|^(alabama)|^(jdjd)|^(bat)/i

```

I thought combining multiple ^(xyz) expressions with | operator will work as the OR operator short-circuits if the left condition is true and first match anything that starts with 'sdkfjhd', if found then only match items that start with 'sdkfjhd'.. otherwise, proceed to the next string 'board' and so on..
so following code

```
var result = $.grep(arr, function( a ){
    return re.test(a);
});

```

produces this output:

```
["Board of Pre University Education", "Alabama Autonomous Board", "Batman Gotham Bruce", "Board of Whatever"]

```

where I just want it to be 

```
["Board of Pre University Education", "Board of Whatever"]

```

So if any left side expression finds a match first, I'm trying to find out a way to skip all the right side expressions. Considering the same input string `"sdkfjhd board hjh alabama jdjd bat"`... 'sdkfjhd' will not produce any result so it moves on to 'board', board finds a match and produces 2 results : `["Board of Pre University Education", "Board of Whatever"]`. Now as its found 1 or more matches, it shouldn't move to the next expressions i.e. 'hjh','alabama','jdjd' or 'batman'. Hope its more clear, thanks!

Any help on this would be greatly appreciated. 
Thanks :)!

PS: Here's a fiddle <http://jsfiddle.net/4h26vLq8/40/>