correctly handle ignorecase setting