Match commands case-insensitively
See original GitHub issueI cannot imagine any scenario in which anyone would want a bot to respond to /foo
, /Foo
and /FOO
differently, so I suggest to match commands case-insensitively in Composer.command
.
Usernames should be matched case-insensitively as well (#287).
Describe alternatives you’ve considered
hears(/^\/foo\b/i, handler)
is less readable, and doesn’t check if usernames match (ie./foo@notMyBot
still runs) and if “command” isn’t just a code block starting with slash,- To achieve case-insensitivity and inspectability (
router.handler
) I wrote own command routing function, to be passed toRouter
constructor. BTW., check it out, I think you may be interested in bringing it into this repo.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
case-insensitive - IBM
The case-insensitive command indicates whether the matching pattern in the control list is case-sensitive or case-insensitive. The matching pattern is evaluated ...
Read more >bash case-insensitive commands matching
One way is to use alias shell builtin, for example: alias Python='python' alias PYTHON='python' alias Python='python' alias pyThoN='python'.
Read more >sed Case Insensitive Search Matching and Replacement
Explains how to perform a case insensitive search and replace using sed command under Linux, macOS or Unix-like operating systems.
Read more >Case-sensitivity (The GNU Awk User's Guide)
One way to perform a case-insensitive match at a particular point in the program is to convert the data to a single case,...
Read more >Case insensitive commands ? : r/vim - Reddit
Hey r/vim ! I've seen in many places where the user types the ex commands/functions, case insensitive, and vim automatically corrects it.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey mate, you can use this permutation snippet (I’m using it already!):
Yes, that would be reasonable.