This commit is contained in:
Adam R Grey 2023-12-01 14:19:55 -05:00
parent d060e92ed9
commit 391ba38cce

View File

@ -15,7 +15,7 @@ public class UnitConvert : Behavior
public override async Task<bool> ActOn(Message message)
{
var theseMatches = Regex.Matches(message.Content, "\\b([\\d]+\\.?\\d*) ?([^\\d\\s].*) (in|to|as) ([^\\d\\s].*)$", RegexOptions.IgnoreCase);
var theseMatches = Regex.Matches(message.Content, "\\s(-?[\\d]+\\.?\\d*) ?([^\\d\\s].*) (in|to|as) ([^\\d\\s].*)$", RegexOptions.IgnoreCase);
if (theseMatches != null && theseMatches.Count > 0 && theseMatches[0].Groups != null && theseMatches[0].Groups.Count == 5)
{