harvesthq/chosen — pull request #1465 by koenpunt (2013-08-11 15:01:02+00:00)
Title: Use word boundary matching

@harvesthq/chosen-developers This fixes #75 (which has been around for 2 years already..), #1463 and actually also #1216, because the provided solution over there won't work.

By making use of word boundary matching (http://www.regular-expressions.info/wordboundaries.html) the split word search is much cleaner (no more actual splitting of strings), and the search results are better.

**Example:**
There is a Chosen select box with the option 'Heard Island and Mcdonald Islands' (like on the [example page](http://harvesthq.github.io/chosen/)). With `enable_split_word_search` set to `true` (default) searching for 'and Mc' won't show any results. Although searching for 'and' and 'Mcdonald' does.

With my modifications the results will show as expected.