Prepare Announcement Regex

This commit is contained in:
Lightczx
2023-08-18 16:41:11 +08:00
parent 1e92edca63
commit 0ea85ae26b
4 changed files with 92 additions and 1 deletions

View File

@@ -5478,6 +5478,51 @@ namespace Snap.Hutao.Resource.Localization {
}
}
/// <summary>
/// 查找类似 (?:〓活动时间〓|〓任务开放时间〓).*?\d\.\d版本更新(?:完成|)后永久开放 的本地化字符串。
/// </summary>
internal static string WebAnnouncementMatchPermanentActivityTime {
get {
return ResourceManager.GetString("WebAnnouncementMatchPermanentActivityTime", resourceCulture);
}
}
/// <summary>
/// 查找类似 〓活动时间〓.*?\d\.\d版本期间持续开放 的本地化字符串。
/// </summary>
internal static string WebAnnouncementMatchPersistentActivityTime {
get {
return ResourceManager.GetString("WebAnnouncementMatchPersistentActivityTime", resourceCulture);
}
}
/// <summary>
/// 查找类似 (?:〓活动时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后|\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}).*?~.*?&amp;lt;t class=&quot;t_(?:gl|lc)&quot;.*?&amp;gt;(.*?)&amp;lt;/t&amp;gt; 的本地化字符串。
/// </summary>
internal static string WebAnnouncementMatchTransientActivityTime {
get {
return ResourceManager.GetString("WebAnnouncementMatchTransientActivityTime", resourceCulture);
}
}
/// <summary>
/// 查找类似 〓更新时间〓.+?&amp;lt;t class=\&quot;t_(?:gl|lc)\&quot;.*?&amp;gt;(.*?)&amp;lt;/t&amp;gt; 的本地化字符串。
/// </summary>
internal static string WebAnnouncementMatchVersionUpdateTime {
get {
return ResourceManager.GetString("WebAnnouncementMatchVersionUpdateTime", resourceCulture);
}
}
/// <summary>
/// 查找类似 \d\.\d版本更新说明 的本地化字符串。
/// </summary>
internal static string WebAnnouncementMatchVersionUpdateTitle {
get {
return ResourceManager.GetString("WebAnnouncementMatchVersionUpdateTitle", resourceCulture);
}
}
/// <summary>
/// 查找类似 {0} 天后开始 的本地化字符串。
/// </summary>
@@ -5828,5 +5873,14 @@ namespace Snap.Hutao.Resource.Localization {
return ResourceManager.GetString("WebResponseRequestExceptionFormat", resourceCulture);
}
}
/// <summary>
/// 查找类似 (?:〓活动时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后|\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}).*?~.*?&amp;lt;t class=&quot;t_(?:gl|lc)&quot;.*?&amp;gt;(.*?)&amp;lt;/t&amp;gt; 的本地化字符串。
/// </summary>
internal static string DD版本更新后D4D2D2D2D2D2LtTClass {
get {
return ResourceManager.GetString("活动时间祈愿时间上架时间DD版本更新后D4D2D2D2D2D2LtTClass", resourceCulture);
}
}
}
}

View File

@@ -1979,6 +1979,21 @@
<data name="ViewWikiWeaponHeader" xml:space="preserve">
<value>武器资料</value>
</data>
<data name="WebAnnouncementMatchPermanentActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|〓任务开放时间〓).*?\d\.\d版本更新(?:完成|)后永久开放</value>
</data>
<data name="WebAnnouncementMatchPersistentActivityTime" xml:space="preserve">
<value>〓活动时间〓.*?\d\.\d版本期间持续开放</value>
</data>
<data name="WebAnnouncementMatchTransientActivityTime" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后|\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}).*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTime" xml:space="preserve">
<value>〓更新时间〓.+?&amp;lt;t class=\"t_(?:gl|lc)\".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
<data name="WebAnnouncementMatchVersionUpdateTitle" xml:space="preserve">
<value>\d\.\d版本更新说明</value>
</data>
<data name="WebAnnouncementTimeDaysBeginFormat" xml:space="preserve">
<value>{0} 天后开始</value>
</data>
@@ -2096,4 +2111,7 @@
<data name="WebResponseRequestExceptionFormat" xml:space="preserve">
<value>[{0}] 中的 [{1}] 网络请求异常,请稍后再试</value>
</data>
<data name="活动时间祈愿时间上架时间DD版本更新后D4D2D2D2D2D2LtTClass" xml:space="preserve">
<value>(?:〓活动时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后|\d{4}/\d{2}/\d{2} \d{2}:\d{2}:\d{2}).*?~.*?&amp;lt;t class="t_(?:gl|lc)".*?&amp;gt;(.*?)&amp;lt;/t&amp;gt;</value>
</data>
</root>

View File

@@ -45,4 +45,4 @@ internal class AnnouncementContent
/// </summary>
[JsonPropertyName("lang")]
public string Lang { get; set; } = default!;
}
}

View File

@@ -0,0 +1,19 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using System.Text.RegularExpressions;
namespace Snap.Hutao.Web.Hoyolab.Hk4e.Common.Announcement;
internal static class AnnouncementRegex
{
public static readonly Regex VersionUpdateTitleRegex = new(SH.WebAnnouncementMatchVersionUpdateTitle, RegexOptions.Compiled);
public static readonly Regex VersionUpdateTimeRegex = new(SH.WebAnnouncementMatchVersionUpdateTime, RegexOptions.Compiled);
public static readonly Regex TransientActivityTimeRegex = new(SH.WebAnnouncementMatchTransientActivityTime, RegexOptions.Compiled);
public static readonly Regex PersistentActivityTimeRegex = new(SH.WebAnnouncementMatchPersistentActivityTime, RegexOptions.Compiled);
public static readonly Regex PermanentActivityTimeRegex = new(SH.WebAnnouncementMatchPermanentActivityTime, RegexOptions.Compiled);
}