feat: 优化正则

This commit is contained in:
MiaoYan JY
2023-10-03 17:00:16 +08:00
parent fef81d8906
commit 117f87f14a

View File

@@ -300,7 +300,7 @@ namespace MaaWpfGui.ViewModels.UI
AddLog(details, detailsColor);
{
Url = CopilotUiUrl;
var linkParser = new Regex(@"AV\d+/\?p=\d+|AV\d+|BV[a-zA-Z0-9]{10}/\?p=\d+|BV[a-zA-Z0-9]{10}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
var linkParser = new Regex(@"(?:av\d+|bv[a-z0-9]{10})(?:\/\?p=\d+)?", RegexOptions.Compiled | RegexOptions.IgnoreCase);
foreach (Match match in linkParser.Matches(details))
{
Url = MaaUrls.BilibiliVideo + match.Value;