| Name | Type | Description |
|---|---|---|
text* | str | Input text that may start with a mode trigger. |
Return the longest mode prefix and mode for text, if any.
Longer prefixes win so multi-character triggers like !! are matched
before their single-character prefixes (!).