PhraseCache is a simple language for matching user input. (see also https://PhraseCache.best) A PhraseCache expression can consist of: ** just a WORD OR PHRASE, e.g.: school lunch time This will match when the phrase appears anywhere in the input, e.g.: Is it lunch time now? ** 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"). So the second line will match e.g. these inputs: That's cool \o/ \O/ You can even match quotes, like this: "\"hello\"" This will only match a "hello" actually put in quotes by the user. ** "OR" combination (comma) fun, enjoying matches when any of the elements is present in input. So the example matches "this is fun" as well as "I am enjoying this". ** "AND" combination (plus) this + that requires all elements to be present in input (in any order). So the example 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 (exclamation mark in front) great + !not matches "this is great", but not "this is not that great". ** match START OF LINE only (with ^) ^hello bot will match "hello bot friend", but not "oh hello bot". ** match END OF LINE only (with $) please do this$ will match "now please do this", but not "please do this now". Start of line and end of line can be combined like this: ^ok!$ matches just "ok" and nothing else. (See "typo" section below.) -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