use flag trait `InputMode` and its inherits to support single/multi matching check