AlphaKretin / bastion-bot

A Discord bot for displaying information about Yu-Gi-Oh! cards.
https://www.patreon.com/alphakretinbots
GNU General Public License v3.0
23 stars 16 forks source link

Regex #48

Closed yankana closed 1 year ago

yankana commented 4 years ago

Support card and text searches using regular expressions

AlphaKretin commented 4 years ago

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.

yankana commented 4 years ago

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

kevinlul commented 1 year ago

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.