[PowerRename]Add `$`, `^` and `.*` to RegEx cheatsheet

This commit is contained in:
PesBandi 2025-01-24 21:36:25 +01:00
Родитель 809791da25
Коммит bf0f0f88d4
2 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -170,7 +170,10 @@ namespace winrt::PowerRenameUI::implementation
auto factory = winrt::get_activation_factory<ResourceManager, IResourceManagerFactory>();
ResourceManager manager = factory.CreateInstance(L"PowerToys.PowerRename.pri");
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L"^", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_StartOfString").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L"$", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_EndOfString").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L".", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_MatchAny").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L".*", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_MatchAnyOrNone").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L"\\d", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_MatchDigit").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L"\\D", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_MatchNonDigit").ValueAsString()));
m_searchRegExShortcuts.Append(winrt::make<PatternSnippet>(L"\\w", manager.MainResourceMap().GetValue(L"Resources/RegExCheatSheet_MatchWordChar").ValueAsString()));

Просмотреть файл

@ -123,9 +123,18 @@
<data name="RegExCheatSheet_Title.Text" xml:space="preserve">
<value>RegEx help</value>
</data>
<data name="RegExCheatSheet_StartOfString" xml:space="preserve">
<value>Start of the string</value>
</data>
<data name="RegExCheatSheet_EndOfString" xml:space="preserve">
<value>End of the string</value>
</data>
<data name="RegExCheatSheet_MatchAny" xml:space="preserve">
<value>Matches any character</value>
</data>
<data name="RegExCheatSheet_MatchAnyOrNone" xml:space="preserve">
<value>Matches zero or more of any character</value>
</data>
<data name="RegExCheatSheet_MatchDigit" xml:space="preserve">
<value>Any digit, short for [0-9]</value>
</data>
@ -133,7 +142,7 @@
<value>A non-digit, short for [^0-9]</value>
</data>
<data name="RegExCheatSheet_MatchNonWS" xml:space="preserve">
<value>A non-whitespace character, short for [^\\s]</value>
<value>A non-whitespace character, short for [^\s]</value>
</data>
<data name="RegExCheatSheet_MatchWordChar" xml:space="preserve">
<value>A word character, short for [a-zA-Z_0-9]</value>