AlphaKretin/bastion-bot

Regex

Closed this issue · 3 comments

Support card and text searches using regular expressions

Sorry for not addressing this earlier, it was during a period I was very busy/distracted. I do intend to improve the search functionality a lot, but I'm still undecided on if and how I want to handle regular expressions. My main worry is that my only user interface is messages on Discord, and being able to parse a user's command such that they can use regex, but don't have to, without confusing users who have no idea what regex is, seems like a slightly daunting task.

You can make separate commands for it or add a flag for the existing ones. For example .searchregex ...

In new Bastion (DawnbrandBots/bastion-bot#343), the Slash Command replacement for .match and .search will support regular expressions. Lucene query strings support regular expressions, and there is a maximum of 10000 automaton states, guarding against expensive queries, catastrophic backtracking, and other pitfalls of accepting general user regular expressions.