Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix roll regex, update a bunch of others #214

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

lunakv
Copy link
Contributor

@lunakv lunakv commented Nov 13, 2023

The regex for file rolling wasn't anchored to the beginning of the query, so searches such as !search o:"roll a d20" were triggering the roll command instead of the search command. That has been fixed.

While I was there, I also did some cleanup to the other regexps that we use:

  • singleQuotedWord was rewritten to only use matching quotes
  • Unnecessary non-capturing groups (and capturing groups which weren't used) were removed
  • Single character alternate groups (a|b|c) were replaced with [abc]
  • Some unnecessary escape characters were removed
  • A space was inserted after the roll command so that !rolld20 is not valid (since that's just weird)
  • Negations of groups which have explicit negated counterparts were replaced (\S instead of [^\s])

I also removed the logic that special-cased Uro as a foreign card. Firstly because I wasn't actually able to replicate the issue (!uro just returns Uro even when that thing is removed), and secondly because even if it does appear again, we can fix it just by adding "uro" into the short names dictionary.

@Fryyyyy Fryyyyy merged commit 4bc2b75 into Fryyyyy:master Nov 13, 2023
4 checks passed
@lunakv lunakv mentioned this pull request Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants