Autocompletion with regex and optional case-sensitivity

This is an attempt to fix #2.

@p-e-w : please review and feel free to ask for changes :)