PhraseCache is a simple language for matching user input. A PhraseCache expression can consist of: -just a word or phrase, e.g.: school lunch time -a quoted string, e.g.: "q&a" "\o/" These strings can contain any special character. They are matched exactly character-by-character, but are case-insensitive. The pattern does not match when it's part of a bigger word (e.g. the first example would not match the input "faq&answers"). You can even match quotes, like this: "\"hello\"" This will only match a "hello" put in quotes by the user. -"or" combination fun, enjoy matches "this is fun" as well as "I am enjoying this". -"and" combination this + that matches "this and that" and "that or this", but not "this one" or "that one". "and" takes precedence over "or", so: the + solution, a + resolution is the same as: (the + solution), (a + resolution) (See "bracketing" below.) -negation great + !not matches "this is great", but not "this is not that great". -match start of line ^hello bot will match "oh hello bot", but not "hello bot friend". -match end of line please do this$ will match "now please do this", but not "please do this now". -bracketing (grouping) (quick, fast) + (solution, resolution) will match "we need a fast solution" as well as "the resolution should be quick". -disallow typos with exclamation mark, e.g.: hi! By default, PhraseCache has a crude typo detection system that allows one typo (1 character added, removed or inserted per input row). It's a cool feature, but arguably could see some improvement. For naive patterns, it sometimes fails badly, e.g. input "I" will also match the pattern "hi". To circumvent this, add an exclamation mark AFTER the phrase in question. (Not before the phrase as that would mean negation.) Advanced features (not really used currently): -add a weight to a sub-pattern: (foo, bar)*0.5