harvesthq/chosen — pull request #424 by xcolour (2012-01-03 03:49:30+00:00)
Title: Custom search separator

This patch makes the token used in search configurable and falls back on current token (" ") if not set.

In my project, I have a list filled with semi-hierarchical options that might look like:

```
app.cpu.load
app.mem.used
system.cpu.load
system.mem.used
```

And I'd like to be able to search for "cpu" and get the relevant entries.

This patch allows me to initialize a chosen field with

```js
foo.chosen({search_separator: "."});
```

And get the desired behavior.

The second commit also enables the use of regexes as the separator. I find this very useful for defining multiple characters to tokenize on (e.g. make three tokens out of "foo:bar-baz" with `/:|-/`).