Skip to content

A Swiss Army knife for developers.

Ported Regex Tester to DevToys 2.0 + Various fixes (#983)

Etienne BAUDOUXb56a0222b4ac
diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIDataGrid.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIDataGrid.cs
index b6ef8b6e5..1b7cf2176 100644
--- a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIDataGrid.cs
+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIDataGrid.cs
@@ -5,7 +5,7 @@ namespace DevToys.Api;
/// <summary>
/// A component that represents a grid that can display data with rows and columns.
/// </summary>
-public interface IUIDataGrid : IUIElementWithChildren
+public interface IUIDataGrid : IUITitledElementWithChildren
{
/// <summary>
/// Gets the title of each column in the data grid.
@@ -44,7 +44,7 @@ public interface IUIDataGrid : IUIElementWithChildren
}
[DebuggerDisplay($"Id = {{{nameof(Id)}}}, SelectedRow = {{{nameof(SelectedRow)}}}")]
-internal sealed class UIDataGrid : UIElementWithChildren, IUIDataGrid, IDisposable
+internal sealed class UIDataGrid : UITitledElementWithChildren, IUIDataGrid, IDisposable
{
private readonly ObservableCollection<IUIDataGridRow> _rows = new();
private string[] _columns = Array.Empty<string>();
diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs
index 3d81cfcc3..eb69f72dc 100644
--- a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs
+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUIMultiLineTextInput.cs
@@ -8,7 +8,7 @@ public interface IUIMultiLineTextInput : IUISingleLineTextInput
/// <summary>
/// Gets the list of spans to highlight in the text document.
/// </summary>
- IReadOnlyList<TextSpan> HighlightedSpans { get; }
+ IReadOnlyList<UIHighlightedTextSpan> HighlightedSpans { get; }
/// <summary>
/// Gets the programming language name to use when colorizing the text in the control.
@@ -25,6 +25,11 @@ public interface IUIMultiLineTextInput : IUISingleLineTextInput
/// </summary>
UITextWrapMode WrapMode { get; }
+ /// <summary>
+ /// Gets the primary selection of the text control. When the selection length is 0, the span indicates the caret position.
+ /// </summary>
+ TextSpan Selection { get; }
+
/// <summary>
/// Raised when <see cref="HighlightedSpans"/> is changed.
/// </summary>
@@ -44,24 +49,30 @@ public interface IUIMultiLineTextInput : IUISingleLineTextInput
/// Raised when <see cref="WrapMode"/> is changed.
/// </summary>
event EventHandler? WrapModeChanged;
+
+ /// <summary>
+ /// Raised when <see cref="Selection"/> is changed.
+ /// </summary>
+ event EventHandler? SelectionChanged;
}
[DebuggerDisplay($"Id = {{{nameof(Id)}}}, Text = {{{nameof(Text)}}}, SyntaxColorizationLanguageName = {{{nameof(SyntaxColorizationLanguageName)}}}")]
internal class UIMultilineTextInput : UISingleLineTextInput, IUIMultiLineTextInput
{
- private IReadOnlyList<TextSpan>? _highlightedSpans;
+ private IReadOnlyList<UIHighlightedTextSpan>? _highlightedSpans;
private string? _syntaxColorizationLanguageName;
private bool _isExtendableToFullScreen;
private UITextWrapMode _wrapMode = UITextWrapMode.Auto;
+ private TextSpan? _selection;
internal UIMultilineTextInput(string? id)
: base(id)
{
}
- public IReadOnlyList<TextSpan> HighlightedSpans
+ public IReadOnlyList<UIHighlightedTextSpan> HighlightedSpans
{
- get => _highlightedSpans ?? Array.Empty<TextSpan>();
+ get => _highlightedSpans ?? Array.Empty<UIHighlightedTextSpan>();
internal set => SetPropertyValue(ref _highlightedSpans, value, HighlightedSpansChanged);
}
@@ -83,10 +94,36 @@ internal class UIMultilineTextInput : UISingleLineTextInput, IUIMultiLineTextInp
internal set => SetPropertyValue(ref _wrapMode, value, WrapModeChanged);
}
+ public TextSpan Selection
+ {
+ get => _selection ?? new TextSpan(0, 0);
+ internal set
+ {
+ if (value != null)
+ {
+ if (value.StartPosition > Text.Length)
+ {
+ ThrowHelper.ThrowArgumentOutOfRangeException(
+ nameof(TextSpan.StartPosition),
+ "The start position of the selection is greater than the text length.");
+ }
+ else if (value.EndPosition > Text.Length)
+ {
+ ThrowHelper.ThrowArgumentOutOfRangeException(
+ nameof(TextSpan.Length),
+ "The end position of the selection is greater than the text length.");
+ }
+ }
+
+ SetPropertyValue(ref _selection, value, SelectionChanged);
+ }
+ }
+
public event EventHandler? HighlightedSpansChanged;
public event EventHandler? SyntaxColorizationLanguageNameChanged;
public event EventHandler? IsExtendableToFullScreenChanged;
public event EventHandler? WrapModeChanged;
+ public event EventHandler? SelectionChanged;
}
public static partial class GUI
@@ -130,7 +167,7 @@ public static partial class GUI
/// <summary>
/// Sets the list of spans to highlight in the text document.
/// </summary>
- public static IUIMultiLineTextInput Highlight(this IUIMultiLineTextInput element, params TextSpan[] spans)
+ public static IUIMultiLineTextInput Highlight(this IUIMultiLineTextInput element, params UIHighlightedTextSpan[] spans)
{
((UIMultilineTextInput)element).HighlightedSpans = spans;
return element;
@@ -189,4 +226,28 @@ public static partial class GUI
((UIMultilineTextInput)element).WrapMode = UITextWrapMode.NoWrap;
return element;
}
+
+ /// <summary>
+ /// Selects the given span in the text document.
+ /// </summary>
+ public static IUIMultiLineTextInput Select(this IUIMultiLineTextInput element, TextSpan span)
+ {
+ if (element is UIMultilineTextInput strongElement)
+ {
+ strongElement.Selection = span;
+ }
+ return element;
+ }
+
+ /// <summary>
+ /// Selects the given span in the text document.
+ /// </summary>
+ public static IUIMultiLineTextInput Select(this IUIMultiLineTextInput element, int start, int length)
+ {
+ if (element is UIMultilineTextInput strongElement)
+ {
+ strongElement.Selection = new TextSpan(start, length);
+ }
+ return element;
+ }
}
diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs
index 99c9fe500..52ddc868d 100644
--- a/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs
+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/IUISinglelineTextInput.cs
@@ -20,11 +20,6 @@ public interface IUISingleLineTextInput : IUITitledElementWithChildren
/// </summary>
string Text { get; }
- /// <summary>
- /// Gets the primary selection of the text control. When the selection length is 0, the span indicates the caret position.
- /// </summary>
- TextSpan Selection { get; }
-
/// <summary>
/// Gets an extra interactive content to display in the command bar of the text input.
/// </summary>
@@ -45,11 +40,6 @@ public interface IUISingleLineTextInput : IUITitledElementWithChildren
/// </summary>
event EventHandler? TextChanged;
- /// <summary>
- /// Raised when <see cref="Selection"/> is changed.
- /// </summary>
- event EventHandler? SelectionChanged;
-
/// <summary>
/// Raised when <see cref="CommandBarExtraContent"/> is changed.
/// </summary>
@@ -62,7 +52,6 @@ internal class UISingleLineTextInput : UITitledElementWithChildren, IUISingleLin
private string? _text;
private bool _isReadOnly;
private bool _canCopyWhenEditable;
- private TextSpan? _selection;
private IUIElement? _commandBarExtraContent;
internal UISingleLineTextInput(string? id)
@@ -102,32 +91,6 @@ internal class UISingleLineTextInput : UITitledElementWithChildren, IUISingleLin
internal set => SetPropertyValue(ref _canCopyWhenEditable, value, CanCopyWhenEditableChanged);
}
- public TextSpan Selection
- {
- get => _selection ?? new TextSpan(0, 0);
- internal set
- {
- _selection = value;
- if (_selection != null)
- {
- if (_selection.StartPosition > Text.Length)
- {
- ThrowHelper.ThrowArgumentOutOfRangeException(
- nameof(TextSpan.StartPosition),
- "The start position of the selection is greater than the text length.");
- }
- else if (_selection.EndPosition > Text.Length)
- {
- ThrowHelper.ThrowArgumentOutOfRangeException(
- nameof(TextSpan.Length),
- "The end position of the selection is greater than the text length.");
- }
- }
- SelectionChanged?.Invoke(this, EventArgs.Empty);
- OnPropertyChanged();
- }
- }
-
public IUIElement? CommandBarExtraContent
{
get => _commandBarExtraContent;
@@ -139,7 +102,6 @@ internal class UISingleLineTextInput : UITitledElementWithChildren, IUISingleLin
public event EventHandler? TextChanged;
public event EventHandler? IsReadOnlyChanged;
public event EventHandler? CanCopyWhenEditableChanged;
- public event EventHandler? SelectionChanged;
public event EventHandler? CommandBarExtraContentChanged;
}
@@ -222,30 +184,6 @@ public static partial class GUI
return element;
}
- /// <summary>
- /// Selects the given span in the text document.
- /// </summary>
- public static T Select<T>(this T element, TextSpan span) where T : IUISingleLineTextInput
- {
- if (element is UISingleLineTextInput strongElement)
- {
- strongElement.Selection = span;
- }
- return element;
- }
-
- /// <summary>
- /// Selects the given span in the text document.
- /// </summary>
- public static T Select<T>(this T element, int start, int length) where T : IUISingleLineTextInput
- {
- if (element is UISingleLineTextInput strongElement)
- {
- strongElement.Selection = new TextSpan(start, length);
- }
- return element;
- }
-
/// <summary>
/// Defines an additional element to display in the command bar.
/// </summary>
diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpan.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpan.cs
new file mode 100644
index 000000000..7241ea004
--- /dev/null
+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpan.cs
@@ -0,0 +1,21 @@
+namespace DevToys.Api;
+
+public record UIHighlightedTextSpan : TextSpan
+{
+ public UIHighlightedTextSpan(int startPosition, int length, UIHighlightedTextSpanColor color = UIHighlightedTextSpanColor.Default)
+ : base(startPosition, length)
+ {
+ Color = color;
+ }
+
+ protected UIHighlightedTextSpan(TextSpan original, UIHighlightedTextSpanColor color = UIHighlightedTextSpanColor.Default)
+ : base(original)
+ {
+ Color = color;
+ }
+
+ /// <summary>
+ /// Gets the color of the highlighted text span.
+ /// </summary>
+ public UIHighlightedTextSpanColor Color { get; }
+}
diff --git a/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpanColor.cs b/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpanColor.cs
new file mode 100644
index 000000000..56e4cf35a
--- /dev/null
+++ b/src/app/dev/DevToys.Api/Tool/GUI/Components/UIHighlightedTextSpanColor.cs
@@ -0,0 +1,12 @@
+namespace DevToys.Api;
+
+public enum UIHighlightedTextSpanColor
+{
+ Default,
+ Blue,
+ Green,
+ Red,
+ Yellow,
+ Purple,
+ Teal
+}
diff --git a/src/app/dev/DevToys.Blazor/Assets/javascript/monacoEditor.ts b/src/app/dev/DevToys.Blazor/Assets/javascript/monacoEditor.ts
index c24752f40..3bf208349 100644
--- a/src/app/dev/DevToys.Blazor/Assets/javascript/monacoEditor.ts
+++ b/src/app/dev/DevToys.Blazor/Assets/javascript/monacoEditor.ts
@@ -233,11 +233,6 @@ class MonacoEditor {
}, context);
}
- public static deltaDecorations(id: string, oldDecorations: string[], newDecorations: monaco.editor.IModelDeltaDecoration[]): string[] {
- const editor = this.getStandaloneCodeEditor(id);
- return editor.deltaDecorations(oldDecorations, newDecorations);
- }
-
public static focus(id: string): void {
const editor = this.getEditor(id);
editor.focus();
diff --git a/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/dark.scss b/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/dark.scss
index 744442aa8..05e4a67d2 100644
--- a/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/dark.scss
+++ b/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/dark.scss
@@ -407,4 +407,12 @@
--ui-file-selector-stroke-color: var(--text-fill-color-disabled);
--ui-file-selector-dragging-background-color: var(--control-fill-color-tertiary);
--ui-file-selector-dragging-stroke-color: var(--text-fill-color-tertiary);
+
+ /* UIMultilineTextImput */
+ --ui-multiline-text-input-highlighted-text-span-background-color-blue: rgb(0, 120, 212);
+ --ui-multiline-text-input-highlighted-text-span-background-color-green: rgb(14, 119, 53);
+ --ui-multiline-text-input-highlighted-text-span-background-color-red: rgb(226, 36, 26);
+ --ui-multiline-text-input-highlighted-text-span-background-color-yellow: rgb(204, 146, 0);
+ --ui-multiline-text-input-highlighted-text-span-background-color-purple: rgb(107, 105, 214);
+ --ui-multiline-text-input-highlighted-text-span-background-color-teal: rgb(3, 131, 135);
}
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/light.scss b/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/light.scss
index 2dd9c3d11..cd552c2de 100644
--- a/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/light.scss
+++ b/src/app/dev/DevToys.Blazor/Assets/sass/theme/macos/light.scss
@@ -407,4 +407,12 @@
--ui-file-selector-stroke-color: var(--text-fill-color-disabled);
--ui-file-selector-dragging-background-color: var(--control-fill-color-tertiary);
--ui-file-selector-dragging-stroke-color: var(--text-fill-color-tertiary);
+
+ /* UIMultilineTextImput */
+ --ui-multiline-text-input-highlighted-text-span-background-color-blue: rgb(66, 173, 255);
+ --ui-multiline-text-input-highlighted-text-span-background-color-green: rgb(66, 255, 132);
+ --ui-multiline-text-input-highlighted-text-span-background-color-red: rgb(255, 80, 71);
+ --ui-multiline-text-input-highlighted-text-span-background-color-yellow: rgb(255, 199, 58);
+ --ui-multiline-text-input-highlighted-text-span-background-color-purple: rgb(157, 155, 255);
+ --ui-multiline-text-input-highlighted-text-span-background-color-teal: rgb(6, 255, 229);
}
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/dark.scss b/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/dark.scss
index fdc3f451e..93473f9dc 100644
--- a/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/dark.scss
+++ b/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/dark.scss
@@ -407,4 +407,12 @@
--ui-file-selector-stroke-color: var(--text-fill-color-disabled);
--ui-file-selector-dragging-background-color: var(--control-fill-color-tertiary);
--ui-file-selector-dragging-stroke-color: var(--text-fill-color-tertiary);
+
+ /* UIMultilineTextImput */
+ --ui-multiline-text-input-highlighted-text-span-background-color-blue: rgba(0, 120, 212);
+ --ui-multiline-text-input-highlighted-text-span-background-color-green: rgb(14, 119, 53);
+ --ui-multiline-text-input-highlighted-text-span-background-color-red: rgb(226, 36, 26);
+ --ui-multiline-text-input-highlighted-text-span-background-color-yellow: rgb(204, 146, 0);
+ --ui-multiline-text-input-highlighted-text-span-background-color-purple: rgb(107, 105, 214);
+ --ui-multiline-text-input-highlighted-text-span-background-color-teal: rgb(3, 131, 135);
}
diff --git a/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/light.scss b/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/light.scss
index b6743157b..1c0050658 100644
--- a/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/light.scss
+++ b/src/app/dev/DevToys.Blazor/Assets/sass/theme/windows/light.scss
@@ -407,4 +407,12 @@
--ui-file-selector-stroke-color: var(--text-fill-color-disabled);
--ui-file-selector-dragging-background-color: var(--subtle-fill-tertiary);
--ui-file-selector-dragging-stroke-color: var(--text-fill-color-tertiary);
+
+ /* UIMultilineTextImput */
+ --ui-multiline-text-input-highlighted-text-span-background-color-blue: rgb(66, 173, 255);
+ --ui-multiline-text-input-highlighted-text-span-background-color-green: rgb(66, 255, 132);
+ --ui-multiline-text-input-highlighted-text-span-background-color-red: rgb(255, 80, 71);
+ --ui-multiline-text-input-highlighted-text-span-background-color-yellow: rgb(255, 199, 58);
+ --ui-multiline-text-input-highlighted-text-span-background-color-purple: rgb(157, 155, 255);
+ --ui-multiline-text-input-highlighted-text-span-background-color-teal: rgb(6, 255, 229);
}
diff --git a/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.cs b/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.cs
index 9f4577e7f..fe14744c3 100644
--- a/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.cs
+++ b/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.cs
@@ -208,10 +208,12 @@ public partial class DataGrid<TRow, TCell, TRowDetail> : JSStyledComponentBase,
if (!CanSelectRow)
{
+ StateHasChanged();
return;
}
else if (row == SelectedRow && !raiseEvent)
{
+ StateHasChanged();
return;
}
else if (row is null)
@@ -244,17 +246,20 @@ public partial class DataGrid<TRow, TCell, TRowDetail> : JSStyledComponentBase,
{
if (CanSelectRow)
{
- OnRowSelected();
-
- if (SelectedIndexChanged.HasDelegate)
+ InvokeAsync(() =>
{
- SelectedIndexChanged.InvokeAsync(SelectedIndex);
- }
+ OnRowSelected();
- if (SelectedRowChanged.HasDelegate)
- {
- SelectedRowChanged.InvokeAsync(SelectedRow);
- }
+ if (SelectedIndexChanged.HasDelegate)
+ {
+ SelectedIndexChanged.InvokeAsync(SelectedIndex);
+ }
+
+ if (SelectedRowChanged.HasDelegate)
+ {
+ SelectedRowChanged.InvokeAsync(SelectedRow);
+ }
+ });
}
}
diff --git a/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.scss b/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.scss
index 2d6932c9d..aeae11030 100644
--- a/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.scss
+++ b/src/app/dev/DevToys.Blazor/Components/Collections/DataGrid/DataGrid.razor.scss
@@ -1,7 +1,6 @@
.data-grid {
position: relative;
width: 100%;
- height: 100%;
flex: 1;
border-collapse: collapse;
border-spacing: 0px;
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/Monaco/TextModel.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/Monaco/TextModel.cs
index 559d68bcc..613d5a787 100644
--- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/Monaco/TextModel.cs
+++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/Monaco/TextModel.cs
@@ -290,8 +290,8 @@ public class TextModel
/// @param ownerId Identifies the editor id in which these decorations should appear. If no `ownerId` is provided, the decorations will appear in all editors that attach this model.
/// @return An array containing the new decorations identifiers.
/// </summary>
- public ValueTask<List<string>> DeltaDecorationsAsync(IJSRuntime runtime, List<string> oldDecorations, List<ModelDeltaDecoration> newDecorations, int? ownerId)
- => runtime.InvokeAsync<List<string>>("devtoys.MonacoEditor.TextModel.deltaDecorations", Uri, oldDecorations, newDecorations, ownerId);
+ public ValueTask<string[]> DeltaDecorationsAsync(IJSRuntime runtime, string[] oldDecorations, ModelDeltaDecoration[] newDecorations, int? ownerId)
+ => runtime.InvokeAsync<string[]>("devtoys.MonacoEditor.TextModel.deltaDecorations", Uri, oldDecorations, newDecorations, ownerId);
/// <summary>
/// Get the options associated with a decoration.
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorBase.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorBase.cs
index 994e8807c..416a0c027 100644
--- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorBase.cs
+++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/MonacoEditorBase.cs
@@ -229,27 +229,24 @@ public abstract class MonacoEditorBase : MefComponentBase, IFocusable
/// <summary>
/// Set the primary selection of the editor. This will remove any secondary cursors.
/// @param selection The new selection
- /// @param source Source of the call that caused the selection
/// </summary>
- internal ValueTask<bool> SetSelectionAsync(Monaco.Range selection, string source)
- => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelection", Id, selection, source);
+ internal ValueTask<bool> SetSelectionAsync(Monaco.Range selection)
+ => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelection", Id, selection);
/// <summary>
/// Set the primary selection of the editor. This will remove any secondary cursors.
/// @param selection The new selection
- /// @param source Source of the call that caused the selection
/// </summary>
- internal ValueTask<bool> SetSelectionAsync(Selection selection, string source)
- => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelection", Id, selection, source);
+ internal ValueTask<bool> SetSelectionAsync(Selection selection)
+ => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelection", Id, selection);
/// <summary>
/// Set the selections for all the cursors of the editor.
/// Cursors will be removed or added, as necessary.
/// @param selections The new selection
- /// @param source Source of the call that caused the selection
/// </summary>
- internal ValueTask<bool> SetSelectionsAsync(List<Selection> selections, string source)
- => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelections", Id, selections, source);
+ internal ValueTask<bool> SetSelectionsAsync(List<Selection> selections)
+ => JSRuntime.InvokeVoidWithErrorHandlingAsync("devtoys.MonacoEditor.setSelections", Id, selections);
/// <summary>
/// Scroll vertically as necessary and reveal lines.
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/RicherMonacoEditorBase.cs b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/RicherMonacoEditorBase.cs
index 6f146e050..14362492c 100644
--- a/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/RicherMonacoEditorBase.cs
+++ b/src/app/dev/DevToys.Blazor/Components/Text/MonacoEditor/RicherMonacoEditorBase.cs
@@ -629,19 +629,17 @@ public class RicherMonacoEditorBase : MonacoEditorBase
/// </summary>
internal async Task<string[]> DeltaDecorationsAsync(string[] oldDecorationIds, ModelDeltaDecoration[] newDecorations)
{
- oldDecorationIds ??= Array.Empty<string>();
+ TextModel textModel = await this.GetModelAsync();
- // Convert the newDecorations object into a JsonElement to get rid of the properties with null values
- string newDecorationsJson = JsonSerializer.Serialize(newDecorations, new JsonSerializerOptions
+ if (textModel is not null)
{
- DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
- PropertyNamingPolicy = JsonNamingPolicy.CamelCase
- });
- JsonElement newDecorationsElement = JsonSerializer.Deserialize<JsonElement>(newDecorationsJson);
- string[] newDecorationIds = await JSRuntime.InvokeAsync<string[]>("devtoys.MonacoEditor.deltaDecorations", Id, oldDecorationIds, newDecorationsElement);
- _deltaDecorationIds.RemoveAll(d => oldDecorationIds.Any(o => o == d));
- _deltaDecorationIds.AddRange(newDecorationIds);
- return newDecorationIds;
+ string[] newDecorationIds = await textModel.DeltaDecorationsAsync(JSRuntime, oldDecorationIds, newDecorations, null);
+ _deltaDecorationIds.RemoveAll(d => oldDecorationIds.Any(o => o == d));
+ _deltaDecorationIds.AddRange(newDecorationIds);
+ return newDecorationIds;
+ }
+
+ return oldDecorationIds ?? Array.Empty<string>();
}
/// <summary>
@@ -650,6 +648,12 @@ public class RicherMonacoEditorBase : MonacoEditorBase
internal Task ResetDeltaDecorationsAsync()
=> DeltaDecorationsAsync(_deltaDecorationIds.ToArray(), Array.Empty<ModelDeltaDecoration>());
+ /// <summary>
+ /// Replaces all the decorations.
+ /// </summary>
+ internal Task ReplaceAllDecorationsByAsync(ModelDeltaDecoration[] newDecorations)
+ => DeltaDecorationsAsync(_deltaDecorationIds.ToArray(), newDecorations);
+
/// <summary>
/// Get the layout info for the editor.
/// </summary>
diff --git a/src/app/dev/DevToys.Blazor/Components/Text/TextBlock/TextBlock.razor.scss b/src/app/dev/DevToys.Blazor/Components/Text/TextBlock/TextBlock.razor.scss
index 32437c978..519f098e3 100644
--- a/src/app/dev/DevToys.Blazor/Components/Text/TextBlock/TextBlock.razor.scss
+++ b/src/app/dev/DevToys.Blazor/Components/Text/TextBlock/TextBlock.razor.scss
@@ -5,6 +5,7 @@
padding: 0;
cursor: default;
user-select: none;
+ white-space: pre-wrap;
-webkit-user-select: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
@@ -86,7 +87,7 @@
}
&.no-wrap {
- white-space: nowrap;
+ white-space: pre;
}
&.trim {
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UIDataGridPresenter.razor b/src/app/dev/DevToys.Blazor/Components/UIElements/UIDataGridPresenter.razor
index be78aa238..93ac9f281 100644
--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UIDataGridPresenter.razor
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UIDataGridPresenter.razor
@@ -3,24 +3,45 @@
@using System.Collections.ObjectModel;
@inherits ComponentBase
-<DataGrid id="@UIDataGrid.Id"
- TRow="IUIDataGridRow"
- TCell="IUIDataGridCell"
- TRowDetail="IUIElement"
- IsVisible="@UIDataGrid.IsVisible"
- IsEnabled="@UIDataGrid.IsEnabled"
- HorizontalAlignment="@UIDataGrid.HorizontalAlignment"
- VerticalAlignment="@UIDataGrid.VerticalAlignment"
- @bind-SelectedIndex="@SelectedIndex"
- Columns="@UIDataGrid.Columns"
- Rows="@UIDataGrid.Rows"
- Context="element"
- CanSelectRow="@UIDataGrid.CanSelectRow"
- Virtualize="true">
- <CellTemplate>
- <UIElementPresenter UIElement="@element.UIElement" />
- </CellTemplate>
- <RowDetailTemplate>
- <UIElementPresenter UIElement="@element" />
- </RowDetailTemplate>
-</DataGrid>
\ No newline at end of file
+<Grid IsVisible="@UIDataGrid.IsVisible"
+ IsEnabled="@UIDataGrid.IsEnabled"
+ HorizontalAlignment="@UIDataGrid.HorizontalAlignment"
+ VerticalAlignment="@UIDataGrid.VerticalAlignment"
+ RowSpacing="6"
+ Rows="@(new List<UIGridLength>
+ {
+ UIGridLength.Auto,
+ new UIGridLength(1, UIGridUnitType.Fraction)
+ })"
+ ColumnSpacing="6"
+ Columns="@(new List<UIGridLength>
+ {
+ new UIGridLength(1, UIGridUnitType.Fraction)
+ })">
+ <GridCell Row="0" Column="0">
+ <TextBlock Text="@UIDataGrid.Title"
+ NoWrap="true"
+ CanTrim="true" />
+ </GridCell>
+ <GridCell Row="1" Column="0">
+ <DataGrid id="@UIDataGrid.Id"
+ TRow="IUIDataGridRow"
+ TCell="IUIDataGridCell"
+ TRowDetail="IUIElement"
+ HorizontalAlignment="UIHorizontalAlignment.Stretch"
+ VerticalAlignment="UIVerticalAlignment.Stretch"
+ @bind-SelectedIndex="@SelectedIndex"
+ Columns="@UIDataGrid.Columns"
+ Rows="@UIDataGrid.Rows"
+ Context="element"
+ CanSelectRow="@UIDataGrid.CanSelectRow"
+ Virtualize="true">
+ <CellTemplate>
+ <UIElementPresenter UIElement="@element.UIElement" />
+ </CellTemplate>
+ <RowDetailTemplate>
+ <UIElementPresenter UIElement="@element" />
+ </RowDetailTemplate>
+ </DataGrid>
+ </GridCell>
+</Grid>
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UILabelPresenter.razor.cs b/src/app/dev/DevToys.Blazor/Components/UIElements/UILabelPresenter.razor.cs
index daf2eaeee..255503eb4 100644
--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UILabelPresenter.razor.cs
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UILabelPresenter.razor.cs
@@ -16,6 +16,12 @@ public partial class UILabelPresenter : ComponentBase, IDisposable
UILabel.StyleChanged += UILabel_StyleChanged;
}
+ protected override void OnParametersSet()
+ {
+ base.OnParametersSet();
+ ApplyStyle();
+ }
+
public void Dispose()
{
UILabel.StyleChanged -= UILabel_StyleChanged;
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor
index bb6c76b52..9527c8a2a 100644
--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor
@@ -15,5 +15,6 @@
OnDidChangeModelContent="OnMonacoEditorTextChangedAsync"
OnTextModelInitializationRequested="OnMonacoTextModelInitializationRequestedAsync"
OnDidInit="OnMonacoEditorInitializedAsync"
+ OnDidChangeCursorSelection="OnMonacoEditorSelectionChanged"
ParentComponent="_textInputWrapper"/>
</UITextInputWrapper>
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.cs b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.cs
index 0ddcb2f00..cd3f1df02 100644
--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.cs
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.cs
@@ -6,10 +6,12 @@ namespace DevToys.Blazor.Components.UIElements;
public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
{
private readonly TaskCompletionSource _monacoInitializationAwaiter = new();
+ private readonly DisposableSemaphore _semaphore = new();
private MonacoEditor _monacoEditor = default!;
private UITextInputWrapper _textInputWrapper = default!;
private bool _ignoreChangeComingFromUIMultiLineTextInput;
+ private bool _ignoreSelectionComingFromUIMultiLineTextInput;
private string _modelName = string.Empty;
[Parameter]
@@ -22,6 +24,8 @@ public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
UIMultiLineTextInput.SyntaxColorizationLanguageNameChanged += UIMultiLineTextInput_SyntaxColorizationLanguageNameChanged;
UIMultiLineTextInput.TextChanged += UIMultiLineTextInput_TextChanged;
UIMultiLineTextInput.IsReadOnlyChanged += UIMultiLineTextInput_IsReadOnlyChanged;
+ UIMultiLineTextInput.SelectionChanged += UIMultiLineTextInput_SelectionChanged;
+ UIMultiLineTextInput.HighlightedSpansChanged += UIMultiLineTextInput_HighlightedSpansChanged;
}
public override ValueTask DisposeAsync()
@@ -29,16 +33,21 @@ public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
UIMultiLineTextInput.SyntaxColorizationLanguageNameChanged -= UIMultiLineTextInput_SyntaxColorizationLanguageNameChanged;
UIMultiLineTextInput.TextChanged -= UIMultiLineTextInput_TextChanged;
UIMultiLineTextInput.IsReadOnlyChanged -= UIMultiLineTextInput_IsReadOnlyChanged;
+ UIMultiLineTextInput.SelectionChanged -= UIMultiLineTextInput_SelectionChanged;
+ UIMultiLineTextInput.HighlightedSpansChanged -= UIMultiLineTextInput_HighlightedSpansChanged;
return base.DisposeAsync();
}
private async void UIMultiLineTextInput_TextChanged(object? sender, EventArgs e)
{
- if (!_ignoreChangeComingFromUIMultiLineTextInput)
+ using (await _semaphore.WaitAsync(CancellationToken.None))
{
- await _monacoInitializationAwaiter.Task;
- await _monacoEditor.SetValueAsync(UIMultiLineTextInput.Text);
+ if (!_ignoreChangeComingFromUIMultiLineTextInput)
+ {
+ await _monacoInitializationAwaiter.Task;
+ await _monacoEditor.SetValueAsync(UIMultiLineTextInput.Text);
+ }
}
}
@@ -57,6 +66,73 @@ public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
});
}
+ private async void UIMultiLineTextInput_SelectionChanged(object? sender, EventArgs e)
+ {
+ if (!_ignoreSelectionComingFromUIMultiLineTextInput)
+ {
+ await _monacoInitializationAwaiter.Task;
+
+ using (await _semaphore.WaitAsync(CancellationToken.None))
+ {
+ TextModel model = await _monacoEditor.GetModelAsync();
+
+ if (model is not null)
+ {
+ Position selectionStartPosition = await model.GetPositionAtAsync(JSRuntime, UIMultiLineTextInput.Selection.StartPosition);
+ Position selectionEndPosition = await model.GetPositionAtAsync(JSRuntime, UIMultiLineTextInput.Selection.EndPosition);
+
+ await _monacoEditor.SetSelectionAsync(new Monaco.Range
+ {
+ StartLineNumber = selectionStartPosition.LineNumber,
+ StartColumn = selectionStartPosition.Column,
+ EndLineNumber = selectionEndPosition.LineNumber,
+ EndColumn = selectionEndPosition.Column
+ });
+ }
+ }
+ }
+ }
+
+ private async void UIMultiLineTextInput_HighlightedSpansChanged(object? sender, EventArgs e)
+ {
+ await _monacoInitializationAwaiter.Task;
+
+ using (await _semaphore.WaitAsync(CancellationToken.None))
+ {
+ TextModel model = await _monacoEditor.GetModelAsync();
+
+ if (model is not null)
+ {
+ var decorations = new ModelDeltaDecoration[UIMultiLineTextInput.HighlightedSpans.Count];
+
+ for (int i = 0; i < decorations.Length; i++)
+ {
+ UIHighlightedTextSpan highlightedSpan = UIMultiLineTextInput.HighlightedSpans[i];
+ Position selectionStartPosition = await model.GetPositionAtAsync(JSRuntime, highlightedSpan.StartPosition);
+ Position selectionEndPosition = await model.GetPositionAtAsync(JSRuntime, highlightedSpan.EndPosition);
+
+ decorations[i]
+ = new ModelDeltaDecoration
+ {
+ Range = new Monaco.Range
+ {
+ StartLineNumber = selectionStartPosition.LineNumber,
+ StartColumn = selectionStartPosition.Column,
+ EndLineNumber = selectionEndPosition.LineNumber,
+ EndColumn = selectionEndPosition.Column
+ },
+ Options = new ModelDecorationOptions
+ {
+ InlineClassName = GetClassNameForHighlightedTextSpan(highlightedSpan)
+ }
+ };
+ }
+
+ await _monacoEditor.ReplaceAllDecorationsByAsync(decorations);
+ }
+ }
+ }
+
private async Task OnMonacoEditorTextChangedAsync(ModelContentChangedEvent ev)
{
if (ev.Changes is not null)
@@ -95,9 +171,48 @@ public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
private Task OnMonacoEditorInitializedAsync()
{
_monacoInitializationAwaiter.TrySetResult();
+
+ UIMultiLineTextInput_HighlightedSpansChanged(UIMultiLineTextInput, EventArgs.Empty);
+ UIMultiLineTextInput_SelectionChanged(UIMultiLineTextInput, EventArgs.Empty);
+
return Task.CompletedTask;
}
+ private async Task OnMonacoEditorSelectionChanged(CursorSelectionChangedEvent newSelection)
+ {
+ await _monacoInitializationAwaiter.Task;
+ TextModel model = await _monacoEditor.GetModelAsync();
+
+ if (model is not null && newSelection.Selection is not null)
+ {
+ var selectionStartPosition
+ = new Position
+ {
+ LineNumber = newSelection.Selection.StartLineNumber,
+ Column = newSelection.Selection.StartColumn
+ };
+ var selectionEndPosition
+ = new Position
+ {
+ LineNumber = newSelection.Selection.EndLineNumber,
+ Column = newSelection.Selection.EndColumn
+ };
+
+ int selectionStartIndex = await model.GetOffsetAtAsync(JSRuntime, selectionStartPosition);
+ int selectionEndIndex = await model.GetOffsetAtAsync(JSRuntime, selectionEndPosition);
+
+ _ignoreSelectionComingFromUIMultiLineTextInput = true;
+ try
+ {
+ UIMultiLineTextInput.Select(new TextSpan(selectionStartIndex, selectionEndIndex - selectionStartIndex));
+ }
+ finally
+ {
+ _ignoreSelectionComingFromUIMultiLineTextInput = false;
+ }
+ }
+ }
+
private StandaloneEditorConstructionOptions OnMonacoConstructionOptions(MonacoEditor monacoEditor)
{
// TODO: if language is plain text, then should we hide line numbers and few other things?
@@ -108,4 +223,19 @@ public partial class UIMultiLineTextInputPresenter : JSStyledComponentBase
Value = UIMultiLineTextInput.Text
};
}
+
+ private static string GetClassNameForHighlightedTextSpan(UIHighlightedTextSpan highlightedTextSpan)
+ {
+ return highlightedTextSpan.Color switch
+ {
+ UIHighlightedTextSpanColor.Default => "ui-multiline-text-input-highlighted-text-span-default",
+ UIHighlightedTextSpanColor.Blue => "ui-multiline-text-input-highlighted-text-span-blue",
+ UIHighlightedTextSpanColor.Green => "ui-multiline-text-input-highlighted-text-span-green",
+ UIHighlightedTextSpanColor.Red => "ui-multiline-text-input-highlighted-text-span-red",
+ UIHighlightedTextSpanColor.Yellow => "ui-multiline-text-input-highlighted-text-span-yellow",
+ UIHighlightedTextSpanColor.Purple => "ui-multiline-text-input-highlighted-text-span-purple",
+ UIHighlightedTextSpanColor.Teal => "ui-multiline-text-input-highlighted-text-span-teal",
+ _ => throw new NotImplementedException()
+ };
+ }
}
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.scss b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.scss
new file mode 100644
index 000000000..a01f2954f
--- /dev/null
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UIMultiLineTextInputPresenter.razor.scss
@@ -0,0 +1,38 @@
+@use "../../Assets/sass/devtoys" as *;
+
+.ui-multiline-text-input-highlighted-text-span {
+ &-default {
+ background-color: var(--text-box-selection-highlight-color);
+ color: var(--text-box-selection-color);
+ }
+
+ &-blue {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-blue);
+ color: var(--text-box-selection-color-blue);
+ }
+
+ &-green {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-green);
+ color: var(--text-box-selection-color-blue);
+ }
+
+ &-red {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-red);
+ color: var(--text-box-selection-color-blue);
+ }
+
+ &-yellow {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-yellow);
+ color: var(--text-box-selection-color-blue);
+ }
+
+ &-purple {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-purple);
+ color: var(--text-box-selection-color-blue);
+ }
+
+ &-teal {
+ background-color: var(--ui-multiline-text-input-highlighted-text-span-background-color-teal);
+ color: var(--text-box-selection-color-blue);
+ }
+}
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Blazor/Components/UIElements/UITextInputWrapper.razor.cs b/src/app/dev/DevToys.Blazor/Components/UIElements/UITextInputWrapper.razor.cs
index 93af9d6be..e5cfa7a31 100644
--- a/src/app/dev/DevToys.Blazor/Components/UIElements/UITextInputWrapper.razor.cs
+++ b/src/app/dev/DevToys.Blazor/Components/UIElements/UITextInputWrapper.razor.cs
@@ -333,11 +333,14 @@ public partial class UITextInputWrapper : MefComponentBase
private void TriggerSmartDetection()
{
- CancellationTokenSource? cancellationSourceToken = _cancellationTokenSource;
- cancellationSourceToken?.Cancel();
- cancellationSourceToken?.Dispose();
- Interlocked.Exchange(ref _cancellationTokenSource, new(TimeSpan.FromSeconds(5)));
- SmartDetectToolsAsync(UITextInput.Text, _cancellationTokenSource.Token).ForgetSafely();
+ if (UITextInput.IsReadOnly)
+ {
+ CancellationTokenSource? cancellationSourceToken = _cancellationTokenSource;
+ cancellationSourceToken?.Cancel();
+ cancellationSourceToken?.Dispose();
+ Interlocked.Exchange(ref _cancellationTokenSource, new(TimeSpan.FromSeconds(5)));
+ SmartDetectToolsAsync(UITextInput.Text, _cancellationTokenSource.Token).ForgetSafely();
+ }
}
private async Task SmartDetectToolsAsync(string text, CancellationToken cancellationToken)
diff --git a/src/app/dev/DevToys.Core/Tools/GuiToolInstance.cs b/src/app/dev/DevToys.Core/Tools/GuiToolInstance.cs
index 0ae549771..25c02b379 100644
--- a/src/app/dev/DevToys.Core/Tools/GuiToolInstance.cs
+++ b/src/app/dev/DevToys.Core/Tools/GuiToolInstance.cs
@@ -85,7 +85,15 @@ public sealed partial class GuiToolInstance : ObservableObject, IDisposable
{
if (_instance.IsValueCreated && _instance.Value is IDisposable disposable)
{
- disposable.Dispose();
+ try
+ {
+ disposable.Dispose();
+ }
+ catch (NotImplementedException) { }
+ catch (Exception ex)
+ {
+ LogDisposingToolFailed(ex, InternalComponentName);
+ }
}
}
@@ -172,4 +180,7 @@ public sealed partial class GuiToolInstance : ObservableObject, IDisposable
[LoggerMessage(3, LogLevel.Error, "Unexpectedly failed to get the view for the tool '{toolName}'.")]
partial void LogGetToolViewFailed(Exception ex, string toolName);
+
+ [LoggerMessage(4, LogLevel.Error, "Unexpectedly failed to dispose '{toolName}'.")]
+ partial void LogDisposingToolFailed(Exception ex, string toolName);
}
diff --git a/src/app/dev/DevToys.Tools/DevToys.Tools.csproj b/src/app/dev/DevToys.Tools/DevToys.Tools.csproj
index 7007d4187..901fb94fa 100644
--- a/src/app/dev/DevToys.Tools/DevToys.Tools.csproj
+++ b/src/app/dev/DevToys.Tools/DevToys.Tools.csproj
@@ -109,6 +109,11 @@
<AutoGen>True</AutoGen>
<DependentUpon>TextCompare.resx</DependentUpon>
</Compile>
+ <Compile Update="Tools\Text\RegExTester\RegExTester.Designer.cs">
+ <DesignTime>True</DesignTime>
+ <AutoGen>True</AutoGen>
+ <DependentUpon>RegExTester.resx</DependentUpon>
+ </Compile>
<Compile Update="Tools\Text\Text.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
@@ -180,6 +185,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>TextCompare.Designer.cs</LastGenOutput>
</EmbeddedResource>
+ <EmbeddedResource Update="Tools\Text\RegExTester\RegExTester.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>RegExTester.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
<EmbeddedResource Update="Tools\Text\Text.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Text.Designer.cs</LastGenOutput>
diff --git a/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/README.md b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/README.md
new file mode 100644
index 000000000..daea5073c
--- /dev/null
+++ b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/README.md
@@ -0,0 +1 @@
+There's no command line tool for Regex. `grep` (Unix) and `findstr` (Windows) are popular and good enough as alternative.
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.Designer.cs b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.Designer.cs
new file mode 100644
index 000000000..a255bc90a
--- /dev/null
+++ b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.Designer.cs
@@ -0,0 +1,1800 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace DevToys.Tools.Tools.Text.RegExTester {
+ using System;
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class RegExTester {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal RegExTester() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DevToys.Tools.Tools.Text.RegExTester.RegExTester", typeof(RegExTester).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Regular Expression Tester tool.
+ /// </summary>
+ internal static string AccessibleName {
+ get {
+ return ResourceManager.GetString("AccessibleName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to All matches.
+ /// </summary>
+ internal static string AllMatches {
+ get {
+ return ResourceManager.GetString("AllMatches", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Find all the matches in the text or stop after the first match..
+ /// </summary>
+ internal static string AllMatchesDescription {
+ get {
+ return ResourceManager.GetString("AllMatchesDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Alternation.
+ /// </summary>
+ internal static string CheatSheetAlternation {
+ get {
+ return ResourceManager.GetString("CheatSheetAlternation", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Acts like a boolean OR. Matches the expression before or after the |.
+ ///It can operate within a group, or on a whole expression. The patterns will be tested in order..
+ /// </summary>
+ internal static string CheatSheetAlternationDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetAlternationDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Any character except newline.
+ /// </summary>
+ internal static string CheatSheetAnyCharacter {
+ get {
+ return ResourceManager.GetString("CheatSheetAnyCharacter", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character other than newline. Equivalent to [^\n\r]..
+ /// </summary>
+ internal static string CheatSheetAnyCharacterDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetAnyCharacterDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Atomic group.
+ /// </summary>
+ internal static string CheatSheetAtomicGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetAtomicGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Non-capturing group that discards backtracking positions once matched.
+ ///For example, /(?&gt;ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option..
+ /// </summary>
+ internal static string CheatSheetAtomicGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetAtomicGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Beginning.
+ /// </summary>
+ internal static string CheatSheetBeginning {
+ get {
+ return ResourceManager.GetString("CheatSheetBeginning", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled. This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetBeginningDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetBeginningDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Beginning of string.
+ /// </summary>
+ internal static string CheatSheetBeginningOfString {
+ get {
+ return ResourceManager.GetString("CheatSheetBeginningOfString", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the beginning of the string. Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetBeginningOfStringDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetBeginningOfStringDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Bell.
+ /// </summary>
+ internal static string CheatSheetBell {
+ get {
+ return ResourceManager.GetString("CheatSheetBell", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a BELL character (char code 7)..
+ /// </summary>
+ internal static string CheatSheetBellDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetBellDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Branch reset group.
+ /// </summary>
+ internal static string CheatSheetBranchResetGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetBranchResetGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Define alternative groups that share the same group numbers.
+ ///For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1..
+ /// </summary>
+ internal static string CheatSheetBranchResetGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetBranchResetGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Capture group.
+ /// </summary>
+ internal static string CheatSheetCaptureGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetCaptureGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Inserts the results of the specified capture group. For example, $3 would insert the third capture group.
+ ///There are multiple syntaxes for this feature:
+ ///
+ ///$1 \1 \{1}.
+ /// </summary>
+ internal static string CheatSheetCaptureGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCaptureGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Capturing group.
+ /// </summary>
+ internal static string CheatSheetCapturingGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetCapturingGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference..
+ /// </summary>
+ internal static string CheatSheetCapturingGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCapturingGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Carriage return.
+ /// </summary>
+ internal static string CheatSheetCarriageReturn {
+ get {
+ return ResourceManager.GetString("CheatSheetCarriageReturn", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a CARRIAGE RETURN character (char code 13)..
+ /// </summary>
+ internal static string CheatSheetCarriageReturnDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCarriageReturnDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Anchors.
+ /// </summary>
+ internal static string CheatSheetCategoryAnchors {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryAnchors", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Character classes.
+ /// </summary>
+ internal static string CheatSheetCategoryCharacterClasses {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryCharacterClasses", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Escaped characters.
+ /// </summary>
+ internal static string CheatSheetCategoryEscapedCharacters {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryEscapedCharacters", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Groups and References.
+ /// </summary>
+ internal static string CheatSheetCategoryGroupsReferences {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryGroupsReferences", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Lookaround.
+ /// </summary>
+ internal static string CheatSheetCategoryLookaround {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryLookaround", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Quantifiers and Alternation.
+ /// </summary>
+ internal static string CheatSheetCategoryQuantifiersAlternation {
+ get {
+ return ResourceManager.GetString("CheatSheetCategoryQuantifiersAlternation", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Special.
+ /// </summary>
+ internal static string CheatSheetCategorySpecial {
+ get {
+ return ResourceManager.GetString("CheatSheetCategorySpecial", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Substitution.
+ /// </summary>
+ internal static string CheatSheetCategorySubstitution {
+ get {
+ return ResourceManager.GetString("CheatSheetCategorySubstitution", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Character range.
+ /// </summary>
+ internal static string CheatSheetCharacterRange {
+ get {
+ return ResourceManager.GetString("CheatSheetCharacterRange", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a character having a character code between the two specified characters inclusive..
+ /// </summary>
+ internal static string CheatSheetCharacterRangeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCharacterRangeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to A single character of A, b or c.
+ /// </summary>
+ internal static string CheatSheetCharacterSet {
+ get {
+ return ResourceManager.GetString("CheatSheetCharacterSet", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches either an A, b or c character.
+ /// </summary>
+ internal static string CheatSheetCharacterSetDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCharacterSetDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Comment.
+ /// </summary>
+ internal static string CheatSheetComment {
+ get {
+ return ResourceManager.GetString("CheatSheetComment", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Allows you to insert a comment into your expression that is ignored when finding a match..
+ /// </summary>
+ internal static string CheatSheetCommentDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetCommentDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Conditional.
+ /// </summary>
+ internal static string CheatSheetConditional {
+ get {
+ return ResourceManager.GetString("CheatSheetConditional", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Conditionally matches one of two options based on whether a lookaround is matched.
+ ///For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.
+ ///
+ ///Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after..
+ /// </summary>
+ internal static string CheatSheetConditionalDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetConditionalDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Control character escape.
+ /// </summary>
+ internal static string CheatSheetControlCharacterEscape {
+ get {
+ return ResourceManager.GetString("CheatSheetControlCharacterEscape", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Escaped control character in the form \cZ. This can range from \cA (SOH, char code 1) to \cZ (SUB, char code 26)..
+ /// </summary>
+ internal static string CheatSheetControlCharacterEscapeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetControlCharacterEscapeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Define.
+ /// </summary>
+ internal static string CheatSheetDefine {
+ get {
+ return ResourceManager.GetString("CheatSheetDefine", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Used to define named groups for use as subroutines without including them in the match.
+ ///For example, /A(?(DEFINE)(?&apos;foo&apos;Z))B\g&apos;foo&apos;/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \g&apos;foo&apos;..
+ /// </summary>
+ internal static string CheatSheetDefineDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetDefineDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Description.
+ /// </summary>
+ internal static string CheatSheetDescription {
+ get {
+ return ResourceManager.GetString("CheatSheetDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Digit.
+ /// </summary>
+ internal static string CheatSheetDigit {
+ get {
+ return ResourceManager.GetString("CheatSheetDigit", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any digit character (0-9). Equivalent to [0-9]..
+ /// </summary>
+ internal static string CheatSheetDigitDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetDigitDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to End.
+ /// </summary>
+ internal static string CheatSheetEnd {
+ get {
+ return ResourceManager.GetString("CheatSheetEnd", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the end of the string, or the end of a line if the multiline flag (m) is enabled. This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetEndDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetEndDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to End of string.
+ /// </summary>
+ internal static string CheatSheetEndOfString {
+ get {
+ return ResourceManager.GetString("CheatSheetEndOfString", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the end of the string. Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetEndOfStringDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetEndOfStringDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Esc.
+ /// </summary>
+ internal static string CheatSheetEsc {
+ get {
+ return ResourceManager.GetString("CheatSheetEsc", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Escaped characters.
+ /// </summary>
+ internal static string CheatSheetEscapedCharacters {
+ get {
+ return ResourceManager.GetString("CheatSheetEscapedCharacters", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to For convenience, these escaped characters are supported in the Replace string in RegExr: \n, \r, \t, \\, and unicode escapes \uFFFF. This may vary in your deploy environment..
+ /// </summary>
+ internal static string CheatSheetEscapedCharactersDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetEscapedCharactersDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Escape sequence.
+ /// </summary>
+ internal static string CheatSheetEscapeSequence {
+ get {
+ return ResourceManager.GetString("CheatSheetEscapeSequence", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to All characters between the \Q and the \E are interpreted as a literal string. If \E is omitted, it continues to the end of the expression. For example, the expression /\Q(?.)\E/ will match the string (?.)..
+ /// </summary>
+ internal static string CheatSheetEscapeSequenceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetEscapeSequenceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a ESC character (char code 27)..
+ /// </summary>
+ internal static string CheatSheetEscDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetEscDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Form feed.
+ /// </summary>
+ internal static string CheatSheetFormFeed {
+ get {
+ return ResourceManager.GetString("CheatSheetFormFeed", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a FORM FEED character (char code 12)..
+ /// </summary>
+ internal static string CheatSheetFormFeedDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetFormFeedDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Group conditional.
+ /// </summary>
+ internal static string CheatSheetGroupConditional {
+ get {
+ return ResourceManager.GetString("CheatSheetGroupConditional", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Conditionally matches one of two options based on whether group &apos;undefined&apos; matched.
+ ///For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.
+ ///
+ ///The same pattern will also match b on its own, because group 1 doesn&apos;t match, so it instead tries to match the second option b.
+ ///
+ ///You can reference a group by name, number, or relative position (ex. -1)..
+ /// </summary>
+ internal static string CheatSheetGroupConditionalDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetGroupConditionalDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Hexadecimal escape.
+ /// </summary>
+ internal static string CheatSheetHexadecimalEscape {
+ get {
+ return ResourceManager.GetString("CheatSheetHexadecimalEscape", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Hexadecimal escaped character in the form \xFF..
+ /// </summary>
+ internal static string CheatSheetHexadecimalEscapeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetHexadecimalEscapeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Horizontal whitespace.
+ /// </summary>
+ internal static string CheatSheetHorizontalWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetHorizontalWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any horizontal whitespace character (spaces, tabs)..
+ /// </summary>
+ internal static string CheatSheetHorizontalWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetHorizontalWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Keep out.
+ /// </summary>
+ internal static string CheatSheetKeepOut {
+ get {
+ return ResourceManager.GetString("CheatSheetKeepOut", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Keep text matched so far out of the returned match, essentially discarding the match up to this point.For example /o\Kbar/ will match bar within the string foobar.
+ /// </summary>
+ internal static string CheatSheetKeepOutDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetKeepOutDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Lazy.
+ /// </summary>
+ internal static string CheatSheetLazy {
+ get {
+ return ResourceManager.GetString("CheatSheetLazy", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Makes the preceding quantifier lazy, causing it to match as few characters as possible. By default, quantifiers are greedy, and will match as many characters as possible.
+ ///This behaviour is reversed by the ungreedy (U) flag/modifier..
+ /// </summary>
+ internal static string CheatSheetLazyDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetLazyDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Line break.
+ /// </summary>
+ internal static string CheatSheetLineBreak {
+ get {
+ return ResourceManager.GetString("CheatSheetLineBreak", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any line break character, including the CRLF pair, and CR / LF individually..
+ /// </summary>
+ internal static string CheatSheetLineBreakDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetLineBreakDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Line feed.
+ /// </summary>
+ internal static string CheatSheetLineFeed {
+ get {
+ return ResourceManager.GetString("CheatSheetLineFeed", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a LINE FEED character (char code 10)..
+ /// </summary>
+ internal static string CheatSheetLineFeedDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetLineFeedDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Match.
+ /// </summary>
+ internal static string CheatSheetMatch {
+ get {
+ return ResourceManager.GetString("CheatSheetMatch", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Match any.
+ /// </summary>
+ internal static string CheatSheetMatchAny {
+ get {
+ return ResourceManager.GetString("CheatSheetMatchAny", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to A character set that can be used to match any character, including line breaks, without the dotall flag (s)..
+ /// </summary>
+ internal static string CheatSheetMatchAnyDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetMatchAnyDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Inserts the matched text.
+ ///There are multiple syntaxes for this feature:
+ ///
+ ///$0 \0 \{0}.
+ /// </summary>
+ internal static string CheatSheetMatchDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetMatchDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Mode modifier.
+ /// </summary>
+ internal static string CheatSheetModeModifier {
+ get {
+ return ResourceManager.GetString("CheatSheetModeModifier", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Enables or disables modes for the remainder of the expression.Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression.
+ ///Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity &amp; multiline modes, and disable dotall.
+ ///
+ ///Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy..
+ /// </summary>
+ internal static string CheatSheetModeModifierDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetModeModifierDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Named capturing group.
+ /// </summary>
+ internal static string CheatSheetNamedCapturingGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedCapturingGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Creates a capturing group that can be referenced via the specified name.
+ ///There are multiple syntaxes for this feature:
+ ///
+ ///(?&apos;name&apos;ABC) (?P&lt;name&gt;ABC) (?&lt;name&gt;ABC).
+ /// </summary>
+ internal static string CheatSheetNamedCapturingGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedCapturingGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Named reference.
+ /// </summary>
+ internal static string CheatSheetNamedReference {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedReference", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the results of a named capture group.
+ ///There are multiple syntaxes for this feature:
+ ///
+ ///\k&apos;name&apos; \k&lt;name&gt; \k{name} \g{name} (?P=name).
+ /// </summary>
+ internal static string CheatSheetNamedReferenceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedReferenceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Named subroutine.
+ /// </summary>
+ internal static string CheatSheetNamedSubroutine {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedSubroutine", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the expression in a capture group. Compare this to a reference, that matches the result.
+ ///There are multiple syntaxes for this feature: \g&lt;name&gt; \g&apos;name&apos; (?&amp;name) (?P&gt;name)..
+ /// </summary>
+ internal static string CheatSheetNamedSubroutineDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNamedSubroutineDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to A character except A, b or c.
+ /// </summary>
+ internal static string CheatSheetNegatedCharacterSet {
+ get {
+ return ResourceManager.GetString("CheatSheetNegatedCharacterSet", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Match any character that is not A, b or c..
+ /// </summary>
+ internal static string CheatSheetNegatedCharacterSetDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNegatedCharacterSetDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Negative lookahead.
+ /// </summary>
+ internal static string CheatSheetNegativeLookahead {
+ get {
+ return ResourceManager.GetString("CheatSheetNegativeLookahead", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Specifies a group that can not match after the main expression (if it matches, the result is discarded)..
+ /// </summary>
+ internal static string CheatSheetNegativeLookaheadDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNegativeLookaheadDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Negative lookbehind.
+ /// </summary>
+ internal static string CheatSheetNegativeLookbehind {
+ get {
+ return ResourceManager.GetString("CheatSheetNegativeLookbehind", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Specifies a group that can not match before the main expression (if it matches, the result is discarded)..
+ /// </summary>
+ internal static string CheatSheetNegativeLookbehindDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNegativeLookbehindDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Non-capturing group.
+ /// </summary>
+ internal static string CheatSheetNonCapturingGroup {
+ get {
+ return ResourceManager.GetString("CheatSheetNonCapturingGroup", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Groups multiple tokens together without creating a capture group..
+ /// </summary>
+ internal static string CheatSheetNonCapturingGroupDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNonCapturingGroupDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not digit.
+ /// </summary>
+ internal static string CheatSheetNotDigit {
+ get {
+ return ResourceManager.GetString("CheatSheetNotDigit", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a digit character (0-9). Equivalent to [^0-9]..
+ /// </summary>
+ internal static string CheatSheetNotDigitDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotDigitDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not horizontal whitespace.
+ /// </summary>
+ internal static string CheatSheetNotHorizontalWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetNotHorizontalWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a horizontal whitespace character (spaces, tabs)..
+ /// </summary>
+ internal static string CheatSheetNotHorizontalWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotHorizontalWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not line break.
+ /// </summary>
+ internal static string CheatSheetNotLineBreak {
+ get {
+ return ResourceManager.GetString("CheatSheetNotLineBreak", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a line break. Similar to dot (.) but is unaffected by the dotall flag (s)..
+ /// </summary>
+ internal static string CheatSheetNotLineBreakDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotLineBreakDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not unicode category.
+ /// </summary>
+ internal static string CheatSheetNotUnicodeCategory {
+ get {
+ return ResourceManager.GetString("CheatSheetNotUnicodeCategory", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not in the specified unicode category..
+ /// </summary>
+ internal static string CheatSheetNotUnicodeCategoryDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotUnicodeCategoryDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not unicode script.
+ /// </summary>
+ internal static string CheatSheetNotUnicodeScript {
+ get {
+ return ResourceManager.GetString("CheatSheetNotUnicodeScript", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not in the specified unicode script..
+ /// </summary>
+ internal static string CheatSheetNotUnicodeScriptDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotUnicodeScriptDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not vertical whitespace.
+ /// </summary>
+ internal static string CheatSheetNotVerticalWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetNotVerticalWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a vertical whitespace character (line breaks)..
+ /// </summary>
+ internal static string CheatSheetNotVerticalWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotVerticalWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not whitespace.
+ /// </summary>
+ internal static string CheatSheetNotWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a whitespace character (spaces, tabs, line breaks)..
+ /// </summary>
+ internal static string CheatSheetNotWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not word.
+ /// </summary>
+ internal static string CheatSheetNotWord {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWord", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Not word boundary.
+ /// </summary>
+ internal static string CheatSheetNotWordBoundary {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWordBoundary", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any position that is not a word boundary. This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetNotWordBoundaryDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWordBoundaryDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character that is not a word character (alphanumeric &amp; underscore). Equivalent to [^A-Za-z0-9_].
+ /// </summary>
+ internal static string CheatSheetNotWordDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNotWordDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Null.
+ /// </summary>
+ internal static string CheatSheetNull {
+ get {
+ return ResourceManager.GetString("CheatSheetNull", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a NULL character (char code 0)..
+ /// </summary>
+ internal static string CheatSheetNullDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNullDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Numeric reference.
+ /// </summary>
+ internal static string CheatSheetNumericReference {
+ get {
+ return ResourceManager.GetString("CheatSheetNumericReference", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the results of a capture group. For example \1 matches the results of the first capture group &amp; \3 matches the third.
+ ///There are multiple syntaxes for this feature: \1 \g1 \g{1}.
+ ///
+ ///The latter syntaxes support relative values preceded by + or -. For example \g-1 would match the group preceding the reference..
+ /// </summary>
+ internal static string CheatSheetNumericReferenceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNumericReferenceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Numeric subroutine.
+ /// </summary>
+ internal static string CheatSheetNumericSubroutine {
+ get {
+ return ResourceManager.GetString("CheatSheetNumericSubroutine", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the expression in a capture group. Compare this to a reference, that matches the result. For example /(a|b)\g&apos;1&apos;/ can match ab, because the expression a|b is evaluated again.
+ ///There are multiple syntaxes for this feature: \g&lt;1&gt; \g&apos;1&apos; (?1).
+ ///
+ ///Relative values preceded by + or - are also supported. For example \g&lt;-1&gt; would match the group preceding the reference..
+ /// </summary>
+ internal static string CheatSheetNumericSubroutineDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetNumericSubroutineDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Octal escape.
+ /// </summary>
+ internal static string CheatSheetOctalEscape {
+ get {
+ return ResourceManager.GetString("CheatSheetOctalEscape", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Octal escaped character in the form \000. Value must be less than 255 (\377).
+ ///The syntax \o{FFF} is also supported..
+ /// </summary>
+ internal static string CheatSheetOctalEscapeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetOctalEscapeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Optional.
+ /// </summary>
+ internal static string CheatSheetOptional {
+ get {
+ return ResourceManager.GetString("CheatSheetOptional", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches 0 or 1 of the preceding token, effectively making it optional..
+ /// </summary>
+ internal static string CheatSheetOptionalDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetOptionalDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Plus.
+ /// </summary>
+ internal static string CheatSheetPlus {
+ get {
+ return ResourceManager.GetString("CheatSheetPlus", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches 1 or more of the preceding token..
+ /// </summary>
+ internal static string CheatSheetPlusDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetPlusDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Positive lookahead.
+ /// </summary>
+ internal static string CheatSheetPositiveLookahead {
+ get {
+ return ResourceManager.GetString("CheatSheetPositiveLookahead", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a group after the main expression without including it in the result..
+ /// </summary>
+ internal static string CheatSheetPositiveLookaheadDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetPositiveLookaheadDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Positive lookbehind.
+ /// </summary>
+ internal static string CheatSheetPositiveLookbehind {
+ get {
+ return ResourceManager.GetString("CheatSheetPositiveLookbehind", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a group before the main expression without including it in the result..
+ /// </summary>
+ internal static string CheatSheetPositiveLookbehindDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetPositiveLookbehindDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Possessive.
+ /// </summary>
+ internal static string CheatSheetPossessive {
+ get {
+ return ResourceManager.GetString("CheatSheetPossessive", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.
+ ///For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a..
+ /// </summary>
+ internal static string CheatSheetPossessiveDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetPossessiveDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Previous match end.
+ /// </summary>
+ internal static string CheatSheetPreviousMatchEnd {
+ get {
+ return ResourceManager.GetString("CheatSheetPreviousMatchEnd", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the end position of the previous match. This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetPreviousMatchEndDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetPreviousMatchEndDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Quantifier.
+ /// </summary>
+ internal static string CheatSheetQuantifier {
+ get {
+ return ResourceManager.GetString("CheatSheetQuantifier", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the specified quantity of the previous token. {1,3} will match 1 to 3. {3} will match exactly 3. {3,} will match 3 or more..
+ /// </summary>
+ internal static string CheatSheetQuantifierDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetQuantifierDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Recursion.
+ /// </summary>
+ internal static string CheatSheetRecursion {
+ get {
+ return ResourceManager.GetString("CheatSheetRecursion", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Attempts to match the full expression again at the current position.
+ ///For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.
+ ///
+ ///There are multiple syntaxes for this feature:
+ ///
+ ///(?R) (?0) \g&lt;0&gt; \g&apos;0&apos;.
+ /// </summary>
+ internal static string CheatSheetRecursionDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetRecursionDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Reserved characters.
+ /// </summary>
+ internal static string CheatSheetReservedCharacters {
+ get {
+ return ResourceManager.GetString("CheatSheetReservedCharacters", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to The following character have special meaning, and should be preceded by a \ (backslash) to represent a literal character:
+ ///+*?^$\.[]{}()|/
+ ///
+ ///Within a character set, only \, -, and ] need to be escaped..
+ /// </summary>
+ internal static string CheatSheetReservedCharactersDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetReservedCharactersDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Star.
+ /// </summary>
+ internal static string CheatSheetStar {
+ get {
+ return ResourceManager.GetString("CheatSheetStar", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches 0 or more of the preceding token..
+ /// </summary>
+ internal static string CheatSheetStarDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetStarDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Strict end of string.
+ /// </summary>
+ internal static string CheatSheetStrictEndOfString {
+ get {
+ return ResourceManager.GetString("CheatSheetStrictEndOfString", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches the end of the string. Unlike $ or \Z, it does not allow for a trailing newline. This is unaffected by the multiline flag (m). This matches a position, not a character..
+ /// </summary>
+ internal static string CheatSheetStrictEndOfStringDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetStrictEndOfStringDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Syntax.
+ /// </summary>
+ internal static string CheatSheetSyntax {
+ get {
+ return ResourceManager.GetString("CheatSheetSyntax", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Tab.
+ /// </summary>
+ internal static string CheatSheetTab {
+ get {
+ return ResourceManager.GetString("CheatSheetTab", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a TAB character (char code 9)..
+ /// </summary>
+ internal static string CheatSheetTabDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetTabDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Cheat sheet.
+ /// </summary>
+ internal static string CheatSheetTitle {
+ get {
+ return ResourceManager.GetString("CheatSheetTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unicode category.
+ /// </summary>
+ internal static string CheatSheetUnicodeCategory {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeCategory", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a character in the specified unicode category. For example, \p{Ll} will match any lowercase letter..
+ /// </summary>
+ internal static string CheatSheetUnicodeCategoryDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeCategoryDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unicode escape.
+ /// </summary>
+ internal static string CheatSheetUnicodeEscape {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeEscape", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unicode escaped character in the form \x{FF}..
+ /// </summary>
+ internal static string CheatSheetUnicodeEscapeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeEscapeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unicode grapheme.
+ /// </summary>
+ internal static string CheatSheetUnicodeGrapheme {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeGrapheme", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any single unicode grapheme (ie. character). This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points..
+ /// </summary>
+ internal static string CheatSheetUnicodeGraphemeDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeGraphemeDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Unicode script.
+ /// </summary>
+ internal static string CheatSheetUnicodeScript {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeScript", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any character in the specified unicode script. For example, \p{Arabic} will match characters in the Arabic script..
+ /// </summary>
+ internal static string CheatSheetUnicodeScriptDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetUnicodeScriptDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Vertical whitespace.
+ /// </summary>
+ internal static string CheatSheetVerticalWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetVerticalWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any vertical whitespace character (line breaks)..
+ /// </summary>
+ internal static string CheatSheetVerticalWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetVerticalWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Whitespace.
+ /// </summary>
+ internal static string CheatSheetWhitespace {
+ get {
+ return ResourceManager.GetString("CheatSheetWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any whitespace character (spaces, tabs, line breaks)..
+ /// </summary>
+ internal static string CheatSheetWhitespaceDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetWhitespaceDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Word.
+ /// </summary>
+ internal static string CheatSheetWord {
+ get {
+ return ResourceManager.GetString("CheatSheetWord", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Word boundary.
+ /// </summary>
+ internal static string CheatSheetWordBoundary {
+ get {
+ return ResourceManager.GetString("CheatSheetWordBoundary", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches a word boundary position between a word character and non-word character or position (start / end of string). See the word character class (w) for more info..
+ /// </summary>
+ internal static string CheatSheetWordBoundaryDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetWordBoundaryDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Matches any word character (alphanumeric &amp; underscore). Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_].
+ /// </summary>
+ internal static string CheatSheetWordDetails {
+ get {
+ return ResourceManager.GetString("CheatSheetWordDetails", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Configuration.
+ /// </summary>
+ internal static string Configuration {
+ get {
+ return ResourceManager.GetString("Configuration", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Culture Invariant.
+ /// </summary>
+ internal static string CultureInvariant {
+ get {
+ return ResourceManager.GetString("CultureInvariant", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Specifies that cultural differences in language is ignored..
+ /// </summary>
+ internal static string CultureInvariantDescription {
+ get {
+ return ResourceManager.GetString("CultureInvariantDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Validate and test regular expressions.
+ /// </summary>
+ internal static string Description {
+ get {
+ return ResourceManager.GetString("Description", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to ECMA Script.
+ /// </summary>
+ internal static string EcmaScript {
+ get {
+ return ResourceManager.GetString("EcmaScript", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the Culture Invariant, Ignore Case and Multiline options..
+ /// </summary>
+ internal static string EcmaScriptDescription {
+ get {
+ return ResourceManager.GetString("EcmaScriptDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Ignore Case.
+ /// </summary>
+ internal static string IgnoreCase {
+ get {
+ return ResourceManager.GetString("IgnoreCase", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Specifies case-insensitive matching..
+ /// </summary>
+ internal static string IgnoreCaseDescription {
+ get {
+ return ResourceManager.GetString("IgnoreCaseDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Ignore Whitespace.
+ /// </summary>
+ internal static string IgnoreWhitespace {
+ get {
+ return ResourceManager.GetString("IgnoreWhitespace", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in character classes, numeric quantifiers, or tokens that mark the beginning of individual regular expression language elements..
+ /// </summary>
+ internal static string IgnoreWhitespaceDescription {
+ get {
+ return ResourceManager.GetString("IgnoreWhitespaceDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Regular Expression Tester.
+ /// </summary>
+ internal static string LongDisplayTitle {
+ get {
+ return ResourceManager.GetString("LongDisplayTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Group.
+ /// </summary>
+ internal static string MatchGroupPrefix {
+ get {
+ return ResourceManager.GetString("MatchGroupPrefix", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Match information.
+ /// </summary>
+ internal static string MatchInformation {
+ get {
+ return ResourceManager.GetString("MatchInformation", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Location.
+ /// </summary>
+ internal static string MatchLocation {
+ get {
+ return ResourceManager.GetString("MatchLocation", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Name.
+ /// </summary>
+ internal static string MatchName {
+ get {
+ return ResourceManager.GetString("MatchName", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Match.
+ /// </summary>
+ internal static string MatchNamePrefix {
+ get {
+ return ResourceManager.GetString("MatchNamePrefix", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Value.
+ /// </summary>
+ internal static string MatchValue {
+ get {
+ return ResourceManager.GetString("MatchValue", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Multiline.
+ /// </summary>
+ internal static string Multiline {
+ get {
+ return ResourceManager.GetString("Multiline", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string..
+ /// </summary>
+ internal static string MultilineDescription {
+ get {
+ return ResourceManager.GetString("MultilineDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Options.
+ /// </summary>
+ internal static string Options {
+ get {
+ return ResourceManager.GetString("Options", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Regular expression.
+ /// </summary>
+ internal static string RegularExpression {
+ get {
+ return ResourceManager.GetString("RegularExpression", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Right To Left.
+ /// </summary>
+ internal static string RightToLeft {
+ get {
+ return ResourceManager.GetString("RightToLeft", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Specifies that the search will be from right to left instead of from left to right..
+ /// </summary>
+ internal static string RightToLeftDescription {
+ get {
+ return ResourceManager.GetString("RightToLeftDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to regular expression.
+ /// </summary>
+ internal static string SearchKeywords {
+ get {
+ return ResourceManager.GetString("SearchKeywords", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to RegEx Tester.
+ /// </summary>
+ internal static string ShortDisplayTitle {
+ get {
+ return ResourceManager.GetString("ShortDisplayTitle", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Singleline.
+ /// </summary>
+ internal static string Singleline {
+ get {
+ return ResourceManager.GetString("Singleline", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Changes the meaning of the dot (.) so it matches every character (instead of every character except \n)..
+ /// </summary>
+ internal static string SinglelineDescription {
+ get {
+ return ResourceManager.GetString("SinglelineDescription", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Text.
+ /// </summary>
+ internal static string Text {
+ get {
+ return ResourceManager.GetString("Text", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.resx b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.resx
new file mode 100644
index 000000000..e81e5b48f
--- /dev/null
+++ b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTester.resx
@@ -0,0 +1,729 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="AccessibleName" xml:space="preserve">
+ <value>Regular Expression Tester tool</value>
+ </data>
+ <data name="AllMatches" xml:space="preserve">
+ <value>All matches</value>
+ </data>
+ <data name="AllMatchesDescription" xml:space="preserve">
+ <value>Find all the matches in the text or stop after the first match.</value>
+ </data>
+ <data name="CheatSheetAlternation" xml:space="preserve">
+ <value>Alternation</value>
+ </data>
+ <data name="CheatSheetAlternationDetails" xml:space="preserve">
+ <value>Acts like a boolean OR. Matches the expression before or after the |.
+It can operate within a group, or on a whole expression. The patterns will be tested in order.</value>
+ </data>
+ <data name="CheatSheetAnyCharacter" xml:space="preserve">
+ <value>Any character except newline</value>
+ </data>
+ <data name="CheatSheetAnyCharacterDetails" xml:space="preserve">
+ <value>Matches any character other than newline. Equivalent to [^\n\r].</value>
+ </data>
+ <data name="CheatSheetAtomicGroup" xml:space="preserve">
+ <value>Atomic group</value>
+ </data>
+ <data name="CheatSheetAtomicGroupDetails" xml:space="preserve">
+ <value>Non-capturing group that discards backtracking positions once matched.
+For example, /(?&gt;ab|a)b/ will match abb but not ab because once the ab option has matched, the atomic group prevents backtracking to retry with the a option.</value>
+ </data>
+ <data name="CheatSheetBeginning" xml:space="preserve">
+ <value>Beginning</value>
+ </data>
+ <data name="CheatSheetBeginningDetails" xml:space="preserve">
+ <value>Matches the beginning of the string, or the beginning of a line if the multiline flag (m) is enabled. This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetBeginningOfString" xml:space="preserve">
+ <value>Beginning of string</value>
+ </data>
+ <data name="CheatSheetBeginningOfStringDetails" xml:space="preserve">
+ <value>Matches the beginning of the string. Unlike ^, this is unaffected by the multiline flag (m). This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetBell" xml:space="preserve">
+ <value>Bell</value>
+ </data>
+ <data name="CheatSheetBellDetails" xml:space="preserve">
+ <value>Matches a BELL character (char code 7).</value>
+ </data>
+ <data name="CheatSheetBranchResetGroup" xml:space="preserve">
+ <value>Branch reset group</value>
+ </data>
+ <data name="CheatSheetBranchResetGroupDetails" xml:space="preserve">
+ <value>Define alternative groups that share the same group numbers.
+For example, in (?|(a)|(b)) both groups (a and b) would be counted as group #1.</value>
+ </data>
+ <data name="CheatSheetCaptureGroup" xml:space="preserve">
+ <value>Capture group</value>
+ </data>
+ <data name="CheatSheetCaptureGroupDetails" xml:space="preserve">
+ <value>Inserts the results of the specified capture group. For example, $3 would insert the third capture group.
+There are multiple syntaxes for this feature:
+
+$1 \1 \{1}</value>
+ </data>
+ <data name="CheatSheetCapturingGroup" xml:space="preserve">
+ <value>Capturing group</value>
+ </data>
+ <data name="CheatSheetCapturingGroupDetails" xml:space="preserve">
+ <value>Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference.</value>
+ </data>
+ <data name="CheatSheetCarriageReturn" xml:space="preserve">
+ <value>Carriage return</value>
+ </data>
+ <data name="CheatSheetCarriageReturnDetails" xml:space="preserve">
+ <value>Matches a CARRIAGE RETURN character (char code 13).</value>
+ </data>
+ <data name="CheatSheetCategoryAnchors" xml:space="preserve">
+ <value>Anchors</value>
+ </data>
+ <data name="CheatSheetCategoryCharacterClasses" xml:space="preserve">
+ <value>Character classes</value>
+ </data>
+ <data name="CheatSheetCategoryEscapedCharacters" xml:space="preserve">
+ <value>Escaped characters</value>
+ </data>
+ <data name="CheatSheetCategoryGroupsReferences" xml:space="preserve">
+ <value>Groups and References</value>
+ </data>
+ <data name="CheatSheetCategoryLookaround" xml:space="preserve">
+ <value>Lookaround</value>
+ </data>
+ <data name="CheatSheetCategoryQuantifiersAlternation" xml:space="preserve">
+ <value>Quantifiers and Alternation</value>
+ </data>
+ <data name="CheatSheetCategorySpecial" xml:space="preserve">
+ <value>Special</value>
+ </data>
+ <data name="CheatSheetCategorySubstitution" xml:space="preserve">
+ <value>Substitution</value>
+ </data>
+ <data name="CheatSheetCharacterRange" xml:space="preserve">
+ <value>Character range</value>
+ </data>
+ <data name="CheatSheetCharacterRangeDetails" xml:space="preserve">
+ <value>Matches a character having a character code between the two specified characters inclusive.</value>
+ </data>
+ <data name="CheatSheetCharacterSet" xml:space="preserve">
+ <value>A single character of A, b or c</value>
+ </data>
+ <data name="CheatSheetCharacterSetDetails" xml:space="preserve">
+ <value>Matches either an A, b or c character</value>
+ </data>
+ <data name="CheatSheetComment" xml:space="preserve">
+ <value>Comment</value>
+ </data>
+ <data name="CheatSheetCommentDetails" xml:space="preserve">
+ <value>Allows you to insert a comment into your expression that is ignored when finding a match.</value>
+ </data>
+ <data name="CheatSheetConditional" xml:space="preserve">
+ <value>Conditional</value>
+ </data>
+ <data name="CheatSheetConditionalDetails" xml:space="preserve">
+ <value>Conditionally matches one of two options based on whether a lookaround is matched.
+For example, /(?(?=a)ab|..)/ will match ab and zx but not ax, because if the first character matches the condition a then it evaluates the pattern ab.
+
+Any lookaround can be used as the condition. A lookahead will start the subsequent match at the start of the condition, a lookbehind will start it after.</value>
+ </data>
+ <data name="CheatSheetControlCharacterEscape" xml:space="preserve">
+ <value>Control character escape</value>
+ </data>
+ <data name="CheatSheetControlCharacterEscapeDetails" xml:space="preserve">
+ <value>Escaped control character in the form \cZ. This can range from \cA (SOH, char code 1) to \cZ (SUB, char code 26).</value>
+ </data>
+ <data name="CheatSheetDefine" xml:space="preserve">
+ <value>Define</value>
+ </data>
+ <data name="CheatSheetDefineDetails" xml:space="preserve">
+ <value>Used to define named groups for use as subroutines without including them in the match.
+For example, /A(?(DEFINE)(?'foo'Z))B\g'foo'/ will match ABZ, because the define group is ignored in the match except to define the foo subroutine that is referenced later with \g'foo'.</value>
+ </data>
+ <data name="CheatSheetDescription" xml:space="preserve">
+ <value>Description</value>
+ </data>
+ <data name="CheatSheetDigit" xml:space="preserve">
+ <value>Digit</value>
+ </data>
+ <data name="CheatSheetDigitDetails" xml:space="preserve">
+ <value>Matches any digit character (0-9). Equivalent to [0-9].</value>
+ </data>
+ <data name="CheatSheetEnd" xml:space="preserve">
+ <value>End</value>
+ </data>
+ <data name="CheatSheetEndDetails" xml:space="preserve">
+ <value>Matches the end of the string, or the end of a line if the multiline flag (m) is enabled. This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetEndOfString" xml:space="preserve">
+ <value>End of string</value>
+ </data>
+ <data name="CheatSheetEndOfStringDetails" xml:space="preserve">
+ <value>Matches the end of the string. Unlike $, this is unaffected by the multiline flag (m). This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetEsc" xml:space="preserve">
+ <value>Esc</value>
+ </data>
+ <data name="CheatSheetEscapedCharacters" xml:space="preserve">
+ <value>Escaped characters</value>
+ </data>
+ <data name="CheatSheetEscapedCharactersDetails" xml:space="preserve">
+ <value>For convenience, these escaped characters are supported in the Replace string in RegExr: \n, \r, \t, \\, and unicode escapes \uFFFF. This may vary in your deploy environment.</value>
+ </data>
+ <data name="CheatSheetEscapeSequence" xml:space="preserve">
+ <value>Escape sequence</value>
+ </data>
+ <data name="CheatSheetEscapeSequenceDetails" xml:space="preserve">
+ <value>All characters between the \Q and the \E are interpreted as a literal string. If \E is omitted, it continues to the end of the expression. For example, the expression /\Q(?.)\E/ will match the string (?.).</value>
+ </data>
+ <data name="CheatSheetEscDetails" xml:space="preserve">
+ <value>Matches a ESC character (char code 27).</value>
+ </data>
+ <data name="CheatSheetFormFeed" xml:space="preserve">
+ <value>Form feed</value>
+ </data>
+ <data name="CheatSheetFormFeedDetails" xml:space="preserve">
+ <value>Matches a FORM FEED character (char code 12).</value>
+ </data>
+ <data name="CheatSheetGroupConditional" xml:space="preserve">
+ <value>Group conditional</value>
+ </data>
+ <data name="CheatSheetGroupConditionalDetails" xml:space="preserve">
+ <value>Conditionally matches one of two options based on whether group 'undefined' matched.
+For example, /(z)?(?(1)a|b)/ will match za because the first capture group matches z successfully, which causes the conditional to match the first option a.
+
+The same pattern will also match b on its own, because group 1 doesn't match, so it instead tries to match the second option b.
+
+You can reference a group by name, number, or relative position (ex. -1).</value>
+ </data>
+ <data name="CheatSheetHexadecimalEscape" xml:space="preserve">
+ <value>Hexadecimal escape</value>
+ </data>
+ <data name="CheatSheetHexadecimalEscapeDetails" xml:space="preserve">
+ <value>Hexadecimal escaped character in the form \xFF.</value>
+ </data>
+ <data name="CheatSheetHorizontalWhitespace" xml:space="preserve">
+ <value>Horizontal whitespace</value>
+ </data>
+ <data name="CheatSheetHorizontalWhitespaceDetails" xml:space="preserve">
+ <value>Matches any horizontal whitespace character (spaces, tabs).</value>
+ </data>
+ <data name="CheatSheetKeepOut" xml:space="preserve">
+ <value>Keep out</value>
+ </data>
+ <data name="CheatSheetKeepOutDetails" xml:space="preserve">
+ <value>Keep text matched so far out of the returned match, essentially discarding the match up to this point.For example /o\Kbar/ will match bar within the string foobar</value>
+ </data>
+ <data name="CheatSheetLazy" xml:space="preserve">
+ <value>Lazy</value>
+ </data>
+ <data name="CheatSheetLazyDetails" xml:space="preserve">
+ <value>Makes the preceding quantifier lazy, causing it to match as few characters as possible. By default, quantifiers are greedy, and will match as many characters as possible.
+This behaviour is reversed by the ungreedy (U) flag/modifier.</value>
+ </data>
+ <data name="CheatSheetLineBreak" xml:space="preserve">
+ <value>Line break</value>
+ </data>
+ <data name="CheatSheetLineBreakDetails" xml:space="preserve">
+ <value>Matches any line break character, including the CRLF pair, and CR / LF individually.</value>
+ </data>
+ <data name="CheatSheetLineFeed" xml:space="preserve">
+ <value>Line feed</value>
+ </data>
+ <data name="CheatSheetLineFeedDetails" xml:space="preserve">
+ <value>Matches a LINE FEED character (char code 10).</value>
+ </data>
+ <data name="CheatSheetMatch" xml:space="preserve">
+ <value>Match</value>
+ </data>
+ <data name="CheatSheetMatchAny" xml:space="preserve">
+ <value>Match any</value>
+ </data>
+ <data name="CheatSheetMatchAnyDetails" xml:space="preserve">
+ <value>A character set that can be used to match any character, including line breaks, without the dotall flag (s).</value>
+ </data>
+ <data name="CheatSheetMatchDetails" xml:space="preserve">
+ <value>Inserts the matched text.
+There are multiple syntaxes for this feature:
+
+$0 \0 \{0}</value>
+ </data>
+ <data name="CheatSheetModeModifier" xml:space="preserve">
+ <value>Mode modifier</value>
+ </data>
+ <data name="CheatSheetModeModifierDetails" xml:space="preserve">
+ <value>Enables or disables modes for the remainder of the expression.Matching modes generally map to expression flags. For example (?i) would enable case insensitivity for the remainder of the expression.
+Multiple modifiers can be specified, and any modifiers that follow - are disabled. For example (?im-s) would enable case insensitivity &amp; multiline modes, and disable dotall.
+
+Supported modifiers are: i - case insensitive, s - dotall, m - multiline, x - free spacing, J - allow duplicate names, U - ungreedy.</value>
+ </data>
+ <data name="CheatSheetNamedCapturingGroup" xml:space="preserve">
+ <value>Named capturing group</value>
+ </data>
+ <data name="CheatSheetNamedCapturingGroupDetails" xml:space="preserve">
+ <value>Creates a capturing group that can be referenced via the specified name.
+There are multiple syntaxes for this feature:
+
+(?'name'ABC) (?P&lt;name&gt;ABC) (?&lt;name&gt;ABC)</value>
+ </data>
+ <data name="CheatSheetNamedReference" xml:space="preserve">
+ <value>Named reference</value>
+ </data>
+ <data name="CheatSheetNamedReferenceDetails" xml:space="preserve">
+ <value>Matches the results of a named capture group.
+There are multiple syntaxes for this feature:
+
+\k'name' \k&lt;name&gt; \k{name} \g{name} (?P=name)</value>
+ </data>
+ <data name="CheatSheetNamedSubroutine" xml:space="preserve">
+ <value>Named subroutine</value>
+ </data>
+ <data name="CheatSheetNamedSubroutineDetails" xml:space="preserve">
+ <value>Matches the expression in a capture group. Compare this to a reference, that matches the result.
+There are multiple syntaxes for this feature: \g&lt;name&gt; \g'name' (?&amp;name) (?P&gt;name).</value>
+ </data>
+ <data name="CheatSheetNegatedCharacterSet" xml:space="preserve">
+ <value>A character except A, b or c</value>
+ </data>
+ <data name="CheatSheetNegatedCharacterSetDetails" xml:space="preserve">
+ <value>Match any character that is not A, b or c.</value>
+ </data>
+ <data name="CheatSheetNegativeLookahead" xml:space="preserve">
+ <value>Negative lookahead</value>
+ </data>
+ <data name="CheatSheetNegativeLookaheadDetails" xml:space="preserve">
+ <value>Specifies a group that can not match after the main expression (if it matches, the result is discarded).</value>
+ </data>
+ <data name="CheatSheetNegativeLookbehind" xml:space="preserve">
+ <value>Negative lookbehind</value>
+ </data>
+ <data name="CheatSheetNegativeLookbehindDetails" xml:space="preserve">
+ <value>Specifies a group that can not match before the main expression (if it matches, the result is discarded).</value>
+ </data>
+ <data name="CheatSheetNonCapturingGroup" xml:space="preserve">
+ <value>Non-capturing group</value>
+ </data>
+ <data name="CheatSheetNonCapturingGroupDetails" xml:space="preserve">
+ <value>Groups multiple tokens together without creating a capture group.</value>
+ </data>
+ <data name="CheatSheetNotDigit" xml:space="preserve">
+ <value>Not digit</value>
+ </data>
+ <data name="CheatSheetNotDigitDetails" xml:space="preserve">
+ <value>Matches any character that is not a digit character (0-9). Equivalent to [^0-9].</value>
+ </data>
+ <data name="CheatSheetNotHorizontalWhitespace" xml:space="preserve">
+ <value>Not horizontal whitespace</value>
+ </data>
+ <data name="CheatSheetNotHorizontalWhitespaceDetails" xml:space="preserve">
+ <value>Matches any character that is not a horizontal whitespace character (spaces, tabs).</value>
+ </data>
+ <data name="CheatSheetNotLineBreak" xml:space="preserve">
+ <value>Not line break</value>
+ </data>
+ <data name="CheatSheetNotLineBreakDetails" xml:space="preserve">
+ <value>Matches any character that is not a line break. Similar to dot (.) but is unaffected by the dotall flag (s).</value>
+ </data>
+ <data name="CheatSheetNotUnicodeCategory" xml:space="preserve">
+ <value>Not unicode category</value>
+ </data>
+ <data name="CheatSheetNotUnicodeCategoryDetails" xml:space="preserve">
+ <value>Matches any character that is not in the specified unicode category.</value>
+ </data>
+ <data name="CheatSheetNotUnicodeScript" xml:space="preserve">
+ <value>Not unicode script</value>
+ </data>
+ <data name="CheatSheetNotUnicodeScriptDetails" xml:space="preserve">
+ <value>Matches any character that is not in the specified unicode script.</value>
+ </data>
+ <data name="CheatSheetNotVerticalWhitespace" xml:space="preserve">
+ <value>Not vertical whitespace</value>
+ </data>
+ <data name="CheatSheetNotVerticalWhitespaceDetails" xml:space="preserve">
+ <value>Matches any character that is not a vertical whitespace character (line breaks).</value>
+ </data>
+ <data name="CheatSheetNotWhitespace" xml:space="preserve">
+ <value>Not whitespace</value>
+ </data>
+ <data name="CheatSheetNotWhitespaceDetails" xml:space="preserve">
+ <value>Matches any character that is not a whitespace character (spaces, tabs, line breaks).</value>
+ </data>
+ <data name="CheatSheetNotWord" xml:space="preserve">
+ <value>Not word</value>
+ </data>
+ <data name="CheatSheetNotWordBoundary" xml:space="preserve">
+ <value>Not word boundary</value>
+ </data>
+ <data name="CheatSheetNotWordBoundaryDetails" xml:space="preserve">
+ <value>Matches any position that is not a word boundary. This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetNotWordDetails" xml:space="preserve">
+ <value>Matches any character that is not a word character (alphanumeric &amp; underscore). Equivalent to [^A-Za-z0-9_]</value>
+ </data>
+ <data name="CheatSheetNull" xml:space="preserve">
+ <value>Null</value>
+ </data>
+ <data name="CheatSheetNullDetails" xml:space="preserve">
+ <value>Matches a NULL character (char code 0).</value>
+ </data>
+ <data name="CheatSheetNumericReference" xml:space="preserve">
+ <value>Numeric reference</value>
+ </data>
+ <data name="CheatSheetNumericReferenceDetails" xml:space="preserve">
+ <value>Matches the results of a capture group. For example \1 matches the results of the first capture group &amp; \3 matches the third.
+There are multiple syntaxes for this feature: \1 \g1 \g{1}.
+
+The latter syntaxes support relative values preceded by + or -. For example \g-1 would match the group preceding the reference.</value>
+ </data>
+ <data name="CheatSheetNumericSubroutine" xml:space="preserve">
+ <value>Numeric subroutine</value>
+ </data>
+ <data name="CheatSheetNumericSubroutineDetails" xml:space="preserve">
+ <value>Matches the expression in a capture group. Compare this to a reference, that matches the result. For example /(a|b)\g'1'/ can match ab, because the expression a|b is evaluated again.
+There are multiple syntaxes for this feature: \g&lt;1&gt; \g'1' (?1).
+
+Relative values preceded by + or - are also supported. For example \g&lt;-1&gt; would match the group preceding the reference.</value>
+ </data>
+ <data name="CheatSheetOctalEscape" xml:space="preserve">
+ <value>Octal escape</value>
+ </data>
+ <data name="CheatSheetOctalEscapeDetails" xml:space="preserve">
+ <value>Octal escaped character in the form \000. Value must be less than 255 (\377).
+The syntax \o{FFF} is also supported.</value>
+ </data>
+ <data name="CheatSheetOptional" xml:space="preserve">
+ <value>Optional</value>
+ </data>
+ <data name="CheatSheetOptionalDetails" xml:space="preserve">
+ <value>Matches 0 or 1 of the preceding token, effectively making it optional.</value>
+ </data>
+ <data name="CheatSheetPlus" xml:space="preserve">
+ <value>Plus</value>
+ </data>
+ <data name="CheatSheetPlusDetails" xml:space="preserve">
+ <value>Matches 1 or more of the preceding token.</value>
+ </data>
+ <data name="CheatSheetPositiveLookahead" xml:space="preserve">
+ <value>Positive lookahead</value>
+ </data>
+ <data name="CheatSheetPositiveLookaheadDetails" xml:space="preserve">
+ <value>Matches a group after the main expression without including it in the result.</value>
+ </data>
+ <data name="CheatSheetPositiveLookbehind" xml:space="preserve">
+ <value>Positive lookbehind</value>
+ </data>
+ <data name="CheatSheetPositiveLookbehindDetails" xml:space="preserve">
+ <value>Matches a group before the main expression without including it in the result.</value>
+ </data>
+ <data name="CheatSheetPossessive" xml:space="preserve">
+ <value>Possessive</value>
+ </data>
+ <data name="CheatSheetPossessiveDetails" xml:space="preserve">
+ <value>Makes the preceding quantifier possessive. It will match as many characters as possible, and will not release them to match subsequent tokens.
+For example /.*a/ would match aaa, but /.*+a/ would not, because the repeating dot would match and not release the last character to match a.</value>
+ </data>
+ <data name="CheatSheetPreviousMatchEnd" xml:space="preserve">
+ <value>Previous match end</value>
+ </data>
+ <data name="CheatSheetPreviousMatchEndDetails" xml:space="preserve">
+ <value>Matches the end position of the previous match. This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetQuantifier" xml:space="preserve">
+ <value>Quantifier</value>
+ </data>
+ <data name="CheatSheetQuantifierDetails" xml:space="preserve">
+ <value>Matches the specified quantity of the previous token. {1,3} will match 1 to 3. {3} will match exactly 3. {3,} will match 3 or more.</value>
+ </data>
+ <data name="CheatSheetRecursion" xml:space="preserve">
+ <value>Recursion</value>
+ </data>
+ <data name="CheatSheetRecursionDetails" xml:space="preserve">
+ <value>Attempts to match the full expression again at the current position.
+For example, /a(?R)?b/ will match any number of a followed by the same number of z: the full text of az or aaaazzzz, but not azzz.
+
+There are multiple syntaxes for this feature:
+
+(?R) (?0) \g&lt;0&gt; \g'0'</value>
+ </data>
+ <data name="CheatSheetReservedCharacters" xml:space="preserve">
+ <value>Reserved characters</value>
+ </data>
+ <data name="CheatSheetReservedCharactersDetails" xml:space="preserve">
+ <value>The following character have special meaning, and should be preceded by a \ (backslash) to represent a literal character:
++*?^$\.[]{}()|/
+
+Within a character set, only \, -, and ] need to be escaped.</value>
+ </data>
+ <data name="CheatSheetStar" xml:space="preserve">
+ <value>Star</value>
+ </data>
+ <data name="CheatSheetStarDetails" xml:space="preserve">
+ <value>Matches 0 or more of the preceding token.</value>
+ </data>
+ <data name="CheatSheetStrictEndOfString" xml:space="preserve">
+ <value>Strict end of string</value>
+ </data>
+ <data name="CheatSheetStrictEndOfStringDetails" xml:space="preserve">
+ <value>Matches the end of the string. Unlike $ or \Z, it does not allow for a trailing newline. This is unaffected by the multiline flag (m). This matches a position, not a character.</value>
+ </data>
+ <data name="CheatSheetSyntax" xml:space="preserve">
+ <value>Syntax</value>
+ </data>
+ <data name="CheatSheetTab" xml:space="preserve">
+ <value>Tab</value>
+ </data>
+ <data name="CheatSheetTabDetails" xml:space="preserve">
+ <value>Matches a TAB character (char code 9).</value>
+ </data>
+ <data name="CheatSheetTitle" xml:space="preserve">
+ <value>Cheat sheet</value>
+ </data>
+ <data name="CheatSheetUnicodeCategory" xml:space="preserve">
+ <value>Unicode category</value>
+ </data>
+ <data name="CheatSheetUnicodeCategoryDetails" xml:space="preserve">
+ <value>Matches a character in the specified unicode category. For example, \p{Ll} will match any lowercase letter.</value>
+ </data>
+ <data name="CheatSheetUnicodeEscape" xml:space="preserve">
+ <value>Unicode escape</value>
+ </data>
+ <data name="CheatSheetUnicodeEscapeDetails" xml:space="preserve">
+ <value>Unicode escaped character in the form \x{FF}.</value>
+ </data>
+ <data name="CheatSheetUnicodeGrapheme" xml:space="preserve">
+ <value>Unicode grapheme</value>
+ </data>
+ <data name="CheatSheetUnicodeGraphemeDetails" xml:space="preserve">
+ <value>Matches any single unicode grapheme (ie. character). This includes line breaks (regardless of the dotall mode) and graphemes encoded as multiple code points.</value>
+ </data>
+ <data name="CheatSheetUnicodeScript" xml:space="preserve">
+ <value>Unicode script</value>
+ </data>
+ <data name="CheatSheetUnicodeScriptDetails" xml:space="preserve">
+ <value>Matches any character in the specified unicode script. For example, \p{Arabic} will match characters in the Arabic script.</value>
+ </data>
+ <data name="CheatSheetVerticalWhitespace" xml:space="preserve">
+ <value>Vertical whitespace</value>
+ </data>
+ <data name="CheatSheetVerticalWhitespaceDetails" xml:space="preserve">
+ <value>Matches any vertical whitespace character (line breaks).</value>
+ </data>
+ <data name="CheatSheetWhitespace" xml:space="preserve">
+ <value>Whitespace</value>
+ </data>
+ <data name="CheatSheetWhitespaceDetails" xml:space="preserve">
+ <value>Matches any whitespace character (spaces, tabs, line breaks).</value>
+ </data>
+ <data name="CheatSheetWord" xml:space="preserve">
+ <value>Word</value>
+ </data>
+ <data name="CheatSheetWordBoundary" xml:space="preserve">
+ <value>Word boundary</value>
+ </data>
+ <data name="CheatSheetWordBoundaryDetails" xml:space="preserve">
+ <value>Matches a word boundary position between a word character and non-word character or position (start / end of string). See the word character class (w) for more info.</value>
+ </data>
+ <data name="CheatSheetWordDetails" xml:space="preserve">
+ <value>Matches any word character (alphanumeric &amp; underscore). Only matches low-ascii characters (no accented or non-roman characters). Equivalent to [A-Za-z0-9_]</value>
+ </data>
+ <data name="Configuration" xml:space="preserve">
+ <value>Configuration</value>
+ </data>
+ <data name="CultureInvariant" xml:space="preserve">
+ <value>Culture Invariant</value>
+ </data>
+ <data name="CultureInvariantDescription" xml:space="preserve">
+ <value>Specifies that cultural differences in language is ignored.</value>
+ </data>
+ <data name="Description" xml:space="preserve">
+ <value>Validate and test regular expressions</value>
+ </data>
+ <data name="EcmaScript" xml:space="preserve">
+ <value>ECMA Script</value>
+ </data>
+ <data name="EcmaScriptDescription" xml:space="preserve">
+ <value>Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the Culture Invariant, Ignore Case and Multiline options.</value>
+ </data>
+ <data name="IgnoreCase" xml:space="preserve">
+ <value>Ignore Case</value>
+ </data>
+ <data name="IgnoreCaseDescription" xml:space="preserve">
+ <value>Specifies case-insensitive matching.</value>
+ </data>
+ <data name="IgnoreWhitespace" xml:space="preserve">
+ <value>Ignore Whitespace</value>
+ </data>
+ <data name="IgnoreWhitespaceDescription" xml:space="preserve">
+ <value>Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in character classes, numeric quantifiers, or tokens that mark the beginning of individual regular expression language elements.</value>
+ </data>
+ <data name="LongDisplayTitle" xml:space="preserve">
+ <value>Regular Expression Tester</value>
+ </data>
+ <data name="MatchGroupPrefix" xml:space="preserve">
+ <value>Group</value>
+ </data>
+ <data name="MatchInformation" xml:space="preserve">
+ <value>Match information</value>
+ </data>
+ <data name="MatchLocation" xml:space="preserve">
+ <value>Location</value>
+ </data>
+ <data name="MatchName" xml:space="preserve">
+ <value>Name</value>
+ </data>
+ <data name="MatchNamePrefix" xml:space="preserve">
+ <value>Match</value>
+ </data>
+ <data name="MatchValue" xml:space="preserve">
+ <value>Value</value>
+ </data>
+ <data name="Multiline" xml:space="preserve">
+ <value>Multiline</value>
+ </data>
+ <data name="MultilineDescription" xml:space="preserve">
+ <value>Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.</value>
+ </data>
+ <data name="Options" xml:space="preserve">
+ <value>Options</value>
+ </data>
+ <data name="RegularExpression" xml:space="preserve">
+ <value>Regular expression</value>
+ </data>
+ <data name="RightToLeft" xml:space="preserve">
+ <value>Right To Left</value>
+ </data>
+ <data name="RightToLeftDescription" xml:space="preserve">
+ <value>Specifies that the search will be from right to left instead of from left to right.</value>
+ </data>
+ <data name="SearchKeywords" xml:space="preserve">
+ <value>regular expression</value>
+ </data>
+ <data name="ShortDisplayTitle" xml:space="preserve">
+ <value>RegEx Tester</value>
+ </data>
+ <data name="Singleline" xml:space="preserve">
+ <value>Singleline</value>
+ </data>
+ <data name="SinglelineDescription" xml:space="preserve">
+ <value>Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).</value>
+ </data>
+ <data name="Text" xml:space="preserve">
+ <value>Text</value>
+ </data>
+</root>
\ No newline at end of file
diff --git a/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTesterGuiTool.cs b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTesterGuiTool.cs
new file mode 100644
index 000000000..a424b7c3e
--- /dev/null
+++ b/src/app/dev/DevToys.Tools/Tools/Text/RegExTester/RegExTesterGuiTool.cs
@@ -0,0 +1,614 @@
+using System.Text.RegularExpressions;
+using Microsoft.Extensions.Logging;
+
+namespace DevToys.Tools.Tools.Text.RegExTester;
+
+[Export(typeof(IGuiTool))]
+[Name("RegExTester")]
+[ToolDisplayInformation(
+ IconFontName = "DevToys-Tools-Icons",
+ IconGlyph = '\u0113',
+ GroupName = PredefinedCommonToolGroupNames.Text,
+ ResourceManagerAssemblyIdentifier = nameof(DevToysToolsResourceManagerAssemblyIdentifier),
+ ResourceManagerBaseName = "DevToys.Tools.Tools.Text.RegExTester.RegExTester",
+ ShortDisplayTitleResourceName = nameof(RegExTester.ShortDisplayTitle),
+ LongDisplayTitleResourceName = nameof(RegExTester.LongDisplayTitle),
+ DescriptionResourceName = nameof(RegExTester.Description),
+ AccessibleNameResourceName = nameof(RegExTester.AccessibleName),
+ SearchKeywordsResourceName = nameof(RegExTester.SearchKeywords))]
+[AcceptedDataTypeName(PredefinedCommonDataTypeNames.Text)]
+internal sealed class RegExTesterGuiTool : IGuiTool, IDisposable
+{
+ private static readonly IUIDataGridRow[] cheatSheetRows
+ = new[]
+ {
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryCharacterClasses),
+ CreateCheatSheetRow(@".", RegExTester.CheatSheetAnyCharacter, RegExTester.CheatSheetAnyCharacterDetails),
+ CreateCheatSheetRow(@"[Abc]", RegExTester.CheatSheetCharacterSet, RegExTester.CheatSheetCharacterSetDetails),
+ CreateCheatSheetRow(@"[^Abc]", RegExTester.CheatSheetNegatedCharacterSet, RegExTester.CheatSheetNegatedCharacterSetDetails),
+ CreateCheatSheetRow(@"[A-Z]", RegExTester.CheatSheetCharacterRange, RegExTester.CheatSheetCharacterRangeDetails),
+ CreateCheatSheetRow(@"[\s\S]", RegExTester.CheatSheetMatchAny, RegExTester.CheatSheetMatchAnyDetails),
+ CreateCheatSheetRow(@"\X", RegExTester.CheatSheetUnicodeGrapheme, RegExTester.CheatSheetUnicodeGraphemeDetails),
+ CreateCheatSheetRow(@"\w", RegExTester.CheatSheetWord, RegExTester.CheatSheetWordDetails),
+ CreateCheatSheetRow(@"\W", RegExTester.CheatSheetNotWord, RegExTester.CheatSheetNotWordDetails),
+ CreateCheatSheetRow(@"\d", RegExTester.CheatSheetDigit, RegExTester.CheatSheetDigitDetails),
+ CreateCheatSheetRow(@"\D", RegExTester.CheatSheetNotDigit, RegExTester.CheatSheetNotDigitDetails),
+ CreateCheatSheetRow(@"\s", RegExTester.CheatSheetWhitespace, RegExTester.CheatSheetWhitespaceDetails),
+ CreateCheatSheetRow(@"\S", RegExTester.CheatSheetNotWhitespace, RegExTester.CheatSheetNotWhitespaceDetails),
+ CreateCheatSheetRow(@"\h", RegExTester.CheatSheetHorizontalWhitespace, RegExTester.CheatSheetHorizontalWhitespaceDetails),
+ CreateCheatSheetRow(@"\H", RegExTester.CheatSheetNotHorizontalWhitespace, RegExTester.CheatSheetNotHorizontalWhitespaceDetails),
+ CreateCheatSheetRow(@"\V", RegExTester.CheatSheetVerticalWhitespace, RegExTester.CheatSheetVerticalWhitespaceDetails),
+ CreateCheatSheetRow(@"\V", RegExTester.CheatSheetNotVerticalWhitespace, RegExTester.CheatSheetNotVerticalWhitespaceDetails),
+ CreateCheatSheetRow(@"\R", RegExTester.CheatSheetLineBreak, RegExTester.CheatSheetLineBreakDetails),
+ CreateCheatSheetRow(@"\N", RegExTester.CheatSheetNotLineBreak, RegExTester.CheatSheetNotLineBreakDetails),
+ CreateCheatSheetRow(@"\p{L}", RegExTester.CheatSheetUnicodeCategory, RegExTester.CheatSheetUnicodeCategoryDetails),
+ CreateCheatSheetRow(@"\P{L}", RegExTester.CheatSheetNotUnicodeCategory, RegExTester.CheatSheetNotUnicodeCategoryDetails),
+ CreateCheatSheetRow(@"\p{Han}", RegExTester.CheatSheetUnicodeScript, RegExTester.CheatSheetUnicodeScriptDetails),
+ CreateCheatSheetRow(@"\P{Han}", RegExTester.CheatSheetNotUnicodeScript, RegExTester.CheatSheetNotUnicodeScriptDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryAnchors),
+ CreateCheatSheetRow(@"\A", RegExTester.CheatSheetBeginningOfString, RegExTester.CheatSheetBeginningOfStringDetails),
+ CreateCheatSheetRow(@"\Z", RegExTester.CheatSheetEndOfString, RegExTester.CheatSheetEndOfStringDetails),
+ CreateCheatSheetRow(@"\z", RegExTester.CheatSheetStrictEndOfString, RegExTester.CheatSheetStrictEndOfStringDetails),
+ CreateCheatSheetRow(@"^", RegExTester.CheatSheetBeginning, RegExTester.CheatSheetBeginningDetails),
+ CreateCheatSheetRow(@"$", RegExTester.CheatSheetEnd, RegExTester.CheatSheetEndDetails),
+ CreateCheatSheetRow(@"\b", RegExTester.CheatSheetWordBoundary, RegExTester.CheatSheetWordBoundaryDetails),
+ CreateCheatSheetRow(@"\B", RegExTester.CheatSheetNotWordBoundary, RegExTester.CheatSheetNotWordBoundaryDetails),
+ CreateCheatSheetRow(@"\G", RegExTester.CheatSheetPreviousMatchEnd, RegExTester.CheatSheetPreviousMatchEndDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryEscapedCharacters),
+ CreateCheatSheetRow(@"\+", RegExTester.CheatSheetReservedCharacters, RegExTester.CheatSheetReservedCharactersDetails),
+ CreateCheatSheetRow(@"\000", RegExTester.CheatSheetOctalEscape, RegExTester.CheatSheetOctalEscapeDetails),
+ CreateCheatSheetRow(@"\xFF", RegExTester.CheatSheetHexadecimalEscape, RegExTester.CheatSheetHexadecimalEscapeDetails),
+ CreateCheatSheetRow(@"\x{FF}", RegExTester.CheatSheetUnicodeEscape, RegExTester.CheatSheetUnicodeEscapeDetails),
+ CreateCheatSheetRow(@"\cI", RegExTester.CheatSheetControlCharacterEscape, RegExTester.CheatSheetControlCharacterEscapeDetails),
+ CreateCheatSheetRow(@"\Q...\E", RegExTester.CheatSheetEscapeSequence, RegExTester.CheatSheetEscapeSequenceDetails),
+ CreateCheatSheetRow(@"\t", RegExTester.CheatSheetTab, RegExTester.CheatSheetTabDetails),
+ CreateCheatSheetRow(@"\n", RegExTester.CheatSheetLineFeed, RegExTester.CheatSheetLineFeedDetails),
+ CreateCheatSheetRow(@"\f", RegExTester.CheatSheetFormFeed, RegExTester.CheatSheetFormFeedDetails),
+ CreateCheatSheetRow(@"\r", RegExTester.CheatSheetCarriageReturn, RegExTester.CheatSheetCarriageReturnDetails),
+ CreateCheatSheetRow(@"\0", RegExTester.CheatSheetNull, RegExTester.CheatSheetNullDetails),
+ CreateCheatSheetRow(@"\a", RegExTester.CheatSheetBell, RegExTester.CheatSheetBellDetails),
+ CreateCheatSheetRow(@"\e", RegExTester.CheatSheetEsc, RegExTester.CheatSheetEscDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryGroupsReferences),
+ CreateCheatSheetRow(@"(ABC)", RegExTester.CheatSheetCapturingGroup, RegExTester.CheatSheetCapturingGroupDetails),
+ CreateCheatSheetRow(@"(?<name>ABC)", RegExTester.CheatSheetNamedCapturingGroup, RegExTester.CheatSheetNamedCapturingGroupDetails),
+ CreateCheatSheetRow(@"\k'name'", RegExTester.CheatSheetNamedReference, RegExTester.CheatSheetNamedReferenceDetails),
+ CreateCheatSheetRow(@"\1", RegExTester.CheatSheetNumericReference, RegExTester.CheatSheetNumericReferenceDetails),
+ CreateCheatSheetRow(@"(?|(a)|(b))", RegExTester.CheatSheetBranchResetGroup, RegExTester.CheatSheetBranchResetGroupDetails),
+ CreateCheatSheetRow(@"(?:ABC)", RegExTester.CheatSheetNonCapturingGroup, RegExTester.CheatSheetNonCapturingGroupDetails),
+ CreateCheatSheetRow(@"(?>ABC)", RegExTester.CheatSheetAtomicGroup, RegExTester.CheatSheetAtomicGroupDetails),
+ CreateCheatSheetRow(@"(?(DEFINE)(?'foo'ABC))", RegExTester.CheatSheetDefine, RegExTester.CheatSheetDefineDetails),
+ CreateCheatSheetRow(@"\g'1'", RegExTester.CheatSheetNumericSubroutine, RegExTester.CheatSheetNumericSubroutineDetails),
+ CreateCheatSheetRow(@"\g'name'", RegExTester.CheatSheetNamedSubroutine, RegExTester.CheatSheetNamedSubroutineDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryLookaround),
+ CreateCheatSheetRow(@"(?=ABC)", RegExTester.CheatSheetPositiveLookahead, RegExTester.CheatSheetPositiveLookaheadDetails),
+ CreateCheatSheetRow(@"(?!ABC)", RegExTester.CheatSheetNegativeLookahead, RegExTester.CheatSheetNegativeLookaheadDetails),
+ CreateCheatSheetRow(@"(?<=ABC)", RegExTester.CheatSheetPositiveLookbehind, RegExTester.CheatSheetPositiveLookbehindDetails),
+ CreateCheatSheetRow(@"(?<!ABC)", RegExTester.CheatSheetNegativeLookbehind, RegExTester.CheatSheetNegativeLookbehindDetails),
+ CreateCheatSheetRow(@"\K", RegExTester.CheatSheetKeepOut, RegExTester.CheatSheetKeepOutDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategoryQuantifiersAlternation),
+ CreateCheatSheetRow(@"+", RegExTester.CheatSheetPlus, RegExTester.CheatSheetPlusDetails),
+ CreateCheatSheetRow(@"*", RegExTester.CheatSheetStar, RegExTester.CheatSheetStarDetails),
+ CreateCheatSheetRow(@"{1,3}", RegExTester.CheatSheetQuantifier, RegExTester.CheatSheetQuantifierDetails),
+ CreateCheatSheetRow(@"?", RegExTester.CheatSheetOptional, RegExTester.CheatSheetOptionalDetails),
+ CreateCheatSheetRow(@"?", RegExTester.CheatSheetLazy, RegExTester.CheatSheetLazyDetails),
+ CreateCheatSheetRow(@"+", RegExTester.CheatSheetPossessive, RegExTester.CheatSheetPossessiveDetails),
+ CreateCheatSheetRow(@"|", RegExTester.CheatSheetAlternation, RegExTester.CheatSheetAlternationDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategorySpecial),
+ CreateCheatSheetRow(@"(?#foo)", RegExTester.CheatSheetComment, RegExTester.CheatSheetCommentDetails),
+ CreateCheatSheetRow(@"(?(?=A)B|C)", RegExTester.CheatSheetConditional, RegExTester.CheatSheetConditionalDetails),
+ CreateCheatSheetRow(@"(?(1)B|C)", RegExTester.CheatSheetGroupConditional, RegExTester.CheatSheetGroupConditionalDetails),
+ CreateCheatSheetRow(@"(?R)", RegExTester.CheatSheetRecursion, RegExTester.CheatSheetRecursionDetails),
+ CreateCheatSheetRow(@"(?i)", RegExTester.CheatSheetModeModifier, RegExTester.CheatSheetModeModifierDetails),
+
+ CreateCheatSheetTitleRow(RegExTester.CheatSheetCategorySubstitution),
+ CreateCheatSheetRow(@"$0", RegExTester.CheatSheetMatch, RegExTester.CheatSheetMatchDetails),
+ CreateCheatSheetRow(@"$1", RegExTester.CheatSheetCaptureGroup, RegExTester.CheatSheetCaptureGroupDetails),
+ CreateCheatSheetRow(@"\n", RegExTester.CheatSheetEscapedCharacters, RegExTester.CheatSheetEscapedCharactersDetails)
+ };
+
+ private static readonly SettingDefinition<bool> allMatches
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(allMatches)}",
+ defaultValue: true);
+
+ private static readonly SettingDefinition<bool> ecmaScript
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(ecmaScript)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> cultureInvariant
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(cultureInvariant)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> ignoreCase
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(ignoreCase)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> ignoreWhitespace
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(ignoreWhitespace)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> singleline
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(singleline)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> multiline
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(multiline)}",
+ defaultValue: false);
+
+ private static readonly SettingDefinition<bool> rightToLeft
+ = new(
+ name: $"{nameof(RegExTesterGuiTool)}.{nameof(rightToLeft)}",
+ defaultValue: false);
+
+ private enum GridRows
+ {
+ TopAuto,
+ Stretch,
+ }
+
+ private enum GridColumns
+ {
+ Stretch
+ }
+
+ private readonly DisposableSemaphore _semaphore = new();
+ private readonly ILogger _logger;
+ private readonly ISettingsProvider _settingsProvider;
+ private readonly IUISetting _ignoreWhitespaceSetting = Setting("regex-tester-ignore-whitespace-setting");
+ private readonly IUISetting _singlelineSetting = Setting("regex-tester-singleline-setting");
+ private readonly IUISetting _rightToLeftSetting = Setting("regex-tester-right-to-left-setting");
+ private readonly IUIDataGrid _matchesDataGrid = DataGrid("regex-tester-match-information-data-grid");
+ private readonly IUISingleLineTextInput _regexInput = SingleLineTextInput("regex-tester-regular-expression-input");
+ private readonly IUIMultiLineTextInput _inputText = MultilineTextInput("regex-tester-text-input");
+
+ private CancellationTokenSource? _cancellationTokenSource;
+
+ [ImportingConstructor]
+ public RegExTesterGuiTool(ISettingsProvider settingsProvider)
+ {
+ _logger = this.Log();
+ _settingsProvider = settingsProvider;
+
+ OnEcmaScriptOptionChangedAsync(_settingsProvider.GetSetting(ecmaScript));
+ }
+
+ // For unit tests.
+ internal Task? WorkTask { get; private set; }
+
+ public UIToolView View
+ => new(
+ isScrollable: false,
+ Grid()
+ .ColumnMediumSpacing()
+
+ .Rows(
+ (GridRows.TopAuto, Auto),
+ (GridRows.Stretch, new UIGridLength(1, UIGridUnitType.Fraction)))
+
+ .Columns(
+ (GridColumns.Stretch, new UIGridLength(1, UIGridUnitType.Fraction)))
+
+ .Cells(
+ Cell(
+ GridRows.TopAuto,
+ GridColumns.Stretch,
+
+ Stack()
+ .Vertical()
+
+ .WithChildren(
+ Label()
+ .Text(RegExTester.Configuration),
+
+ SettingGroup("regex-tester-settings")
+ .Icon("FluentSystemIcons", '\uF6A9')
+ .Title(RegExTester.Options)
+
+ .WithSettings(
+ Setting("regex-tester-all-matches-setting")
+ .Title(RegExTester.AllMatches)
+ .Description(RegExTester.AllMatchesDescription)
+ .Handle(
+ _settingsProvider,
+ allMatches,
+ stateDescriptionWhenOn: RegExTester.AllMatches,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ Setting("regex-tester-ecma-script-setting")
+ .Title(RegExTester.EcmaScript)
+ .Description(RegExTester.EcmaScriptDescription)
+ .Handle(
+ _settingsProvider,
+ ecmaScript,
+ stateDescriptionWhenOn: RegExTester.EcmaScript,
+ stateDescriptionWhenOff: null,
+ OnEcmaScriptOptionChangedAsync),
+
+ Setting("regex-tester-culture-invariant-setting")
+ .Title(RegExTester.CultureInvariant)
+ .Description(RegExTester.CultureInvariantDescription)
+ .Handle(
+ _settingsProvider,
+ cultureInvariant,
+ stateDescriptionWhenOn: RegExTester.CultureInvariant,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ Setting("regex-tester-ignore-case-setting")
+ .Title(RegExTester.IgnoreCase)
+ .Description(RegExTester.IgnoreCaseDescription)
+ .Handle(
+ _settingsProvider,
+ ignoreCase,
+ stateDescriptionWhenOn: RegExTester.IgnoreCase,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ _ignoreWhitespaceSetting
+ .Title(RegExTester.IgnoreWhitespace)
+ .Description(RegExTester.IgnoreWhitespaceDescription)
+ .Handle(
+ _settingsProvider,
+ ignoreWhitespace,
+ stateDescriptionWhenOn: RegExTester.IgnoreWhitespace,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ _singlelineSetting
+ .Title(RegExTester.Singleline)
+ .Description(RegExTester.SinglelineDescription)
+ .Handle(
+ _settingsProvider,
+ singleline,
+ stateDescriptionWhenOn: RegExTester.Singleline,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ Setting("regex-tester-multiline-setting")
+ .Title(RegExTester.Multiline)
+ .Description(RegExTester.MultilineDescription)
+ .Handle(
+ _settingsProvider,
+ multiline,
+ stateDescriptionWhenOn: RegExTester.Multiline,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync),
+
+ _rightToLeftSetting
+ .Title(RegExTester.RightToLeft)
+ .Description(RegExTester.RightToLeftDescription)
+ .Handle(
+ _settingsProvider,
+ rightToLeft,
+ stateDescriptionWhenOn: RegExTester.RightToLeft,
+ stateDescriptionWhenOff: null,
+ OnSettingChangedAsync)))),
+
+ Cell(
+ GridRows.Stretch,
+ GridColumns.Stretch,
+
+ SplitGrid()
+ .Vertical()
+ .LeftPaneLength(new UIGridLength(2, UIGridUnitType.Fraction))
+ .RightPaneLength(new UIGridLength(1, UIGridUnitType.Fraction))
+
+ .WithLeftPaneChild(
+ Grid()
+ .ColumnMediumSpacing()
+
+ .Rows(
+ (GridRows.TopAuto, Auto),
+ (GridRows.Stretch, new UIGridLength(1, UIGridUnitType.Fraction)))
+
+ .Columns(
+ (GridColumns.Stretch, new UIGridLength(1, UIGridUnitType.Fraction)))
+
+ .Cells(
+ Cell(
+ GridRows.TopAuto,
+ GridColumns.Stretch,
+
+ _regexInput
+ .Title(RegExTester.RegularExpression)
+ .OnTextChanged(OnRegularExpressionChangedAsync)),
+
+ Cell(
+ GridRows.Stretch,
+ GridColumns.Stretch,
+
+ _inputText
+ .Title(RegExTester.Text)
+ .OnTextChanged(OnTextChangedAsync))))
+
+ .WithRightPaneChild(
+ SplitGrid()
+ .Horizontal()
+
+ .WithTopPaneChild(
+ DataGrid()
+ .Title(RegExTester.CheatSheetTitle)
+ .WithColumns(RegExTester.CheatSheetDescription, RegExTester.CheatSheetSyntax)
+ .WithRows(cheatSheetRows))
+
+ .WithBottomPaneChild(
+ _matchesDataGrid
+ .Title(RegExTester.MatchInformation)
+ .WithColumns(
+ RegExTester.MatchName,
+ RegExTester.MatchLocation,
+ RegExTester.MatchValue)
+ .OnRowSelected(OnMatchesDataGridRowSelected))))));
+
+ public void OnDataReceived(string dataTypeName, object? parsedData)
+ {
+ if (dataTypeName == PredefinedCommonDataTypeNames.Text && parsedData is string text)
+ {
+ _inputText.Text(text); // This will trigger a regex test.
+ }
+ }
+
+ public void Dispose()
+ {
+ _cancellationTokenSource?.Dispose();
+ _semaphore.Dispose();
+ }
+
+ private ValueTask OnEcmaScriptOptionChangedAsync(bool value)
+ {
+ if (value)
+ {
+ _settingsProvider.SetSetting(ignoreWhitespace, false);
+ _settingsProvider.SetSetting(singleline, false);
+ _settingsProvider.SetSetting(rightToLeft, false);
+ _ignoreWhitespaceSetting.Disable();
+ _singlelineSetting.Disable();
+ _rightToLeftSetting.Disable();
+ }
+ else
+ {
+ _ignoreWhitespaceSetting.Enable();
+ _singlelineSetting.Enable();
+ _rightToLeftSetting.Enable();
+ }
+
+ return OnSettingChangedAsync(value);
+ }
+
+ private void OnMatchesDataGridRowSelected(IUIDataGridRow? selectedRow)
+ {
+ if (selectedRow is not null)
+ {
+ if (selectedRow.Value is Capture matchOrGroup)
+ {
+ _inputText.Select(matchOrGroup.Index, matchOrGroup.Length);
+ }
+ }
+ else
+ {
+ _inputText.Select(0, 0);
+ }
+ }
+
+ private ValueTask OnSettingChangedAsync(bool _)
+ {
+ StartRegExMatch();
+ return ValueTask.CompletedTask;
+ }
+
+ private ValueTask OnRegularExpressionChangedAsync(string regularExpression)
+ {
+ StartRegExMatch();
+ return ValueTask.CompletedTask;
+ }
+
+ private ValueTask OnTextChangedAsync(string regularExpression)
+ {
+ StartRegExMatch();
+ return ValueTask.CompletedTask;
+ }
+
+ private void StartRegExMatch()
+ {
+ _cancellationTokenSource?.Cancel();
+ _cancellationTokenSource?.Dispose();
+ _cancellationTokenSource = new CancellationTokenSource();
+
+ WorkTask
+ = RegExMatchAsync(
+ _regexInput.Text,
+ _inputText.Text,
+ _settingsProvider.GetSetting(allMatches),
+ _settingsProvider.GetSetting(ecmaScript),
+ _settingsProvider.GetSetting(cultureInvariant),
+ _settingsProvider.GetSetting(ignoreCase),
+ _settingsProvider.GetSetting(ignoreWhitespace),
+ _settingsProvider.GetSetting(singleline),
+ _settingsProvider.GetSetting(multiline),
+ _settingsProvider.GetSetting(rightToLeft),
+ _cancellationTokenSource.Token);
+ }
+
+ private async Task RegExMatchAsync(
+ string regex,
+ string text,
+ bool allMatches,
+ bool isEcmaScript,
+ bool isCultureInvariant,
+ bool ignoreCase,
+ bool ignoreWhitespace,
+ bool singleline,
+ bool multiline,
+ bool rightToLeft,
+ CancellationToken cancellationToken)
+ {
+ using (await _semaphore.WaitAsync(cancellationToken))
+ {
+ await TaskSchedulerAwaiter.SwitchOffMainThreadAsync(cancellationToken);
+
+ try
+ {
+ RegexOptions options
+ = GetRegexOptions(
+ isEcmaScript,
+ isCultureInvariant,
+ ignoreCase,
+ ignoreWhitespace,
+ singleline,
+ multiline,
+ rightToLeft);
+
+ var regexObject = new Regex(regex, options);
+ MatchCollection matches = regexObject.Matches(text);
+
+ int amountOfColorsInUIHighlightedTextSpanColor = Enum.GetNames(typeof(UIHighlightedTextSpanColor)).Length;
+
+ var highlightedSpans = new List<UIHighlightedTextSpan>();
+ var gridRows = new List<IUIDataGridRow>();
+
+ for (int i = 0; i < matches.Count; i++)
+ {
+ Match match = matches[i];
+ if (match.Length > 0)
+ {
+ highlightedSpans.Add(
+ new UIHighlightedTextSpan(
+ match.Index,
+ match.Length,
+ UIHighlightedTextSpanColor.Blue));
+
+ gridRows.Add(
+ Row(
+ match,
+ Cell($"{RegExTester.MatchNamePrefix} {i + 1}\t"),
+ Cell(Label().Style(UILabelStyle.Caption).NeverWrap().Text($"{match.Index}-{match.Index + match.Length}")),
+ Cell(match.Value)));
+
+ // Start from 1 to skip the first group which is the entire match
+ for (int j = 1; j < match.Groups.Count; j++)
+ {
+ Group group = match.Groups[j];
+ if (group.Length > 0)
+ {
+ // Skip the first two values of the enum
+ var color = (UIHighlightedTextSpanColor)(((j - 1) % (amountOfColorsInUIHighlightedTextSpanColor - 2)) + 2);
+
+ highlightedSpans.Add(
+ new UIHighlightedTextSpan(
+ group.Index,
+ group.Length,
+ color));
+
+ gridRows.Add(
+ Row(
+ group,
+ Cell($"\t{RegExTester.MatchGroupPrefix} {group.Name}\t"),
+ Cell(Label().Style(UILabelStyle.Caption).NeverWrap().Text($"{group.Index}-{group.Index + group.Length}")),
+ Cell(group.Value)));
+ }
+ }
+ }
+
+ if (!allMatches)
+ {
+ break;
+ }
+ }
+
+ _inputText.Highlight(highlightedSpans.ToArray());
+
+ _matchesDataGrid.WithRows(gridRows.ToArray());
+ }
+ catch (Exception ex)
+ {
+ _logger.LogError(ex, "Error while matching regular expression.");
+ }
+ }
+ }
+
+ private static RegexOptions GetRegexOptions(
+ bool isEcmaScript,
+ bool isCultureInvariant,
+ bool ignoreCase,
+ bool ignoreWhitespace,
+ bool singleline,
+ bool multiline,
+ bool rightToLeft)
+ {
+ RegexOptions options = RegexOptions.None;
+
+ if (isEcmaScript)
+ {
+ options |= RegexOptions.ECMAScript;
+ }
+
+ if (isCultureInvariant)
+ {
+ options |= RegexOptions.CultureInvariant;
+ }
+
+ if (ignoreCase)
+ {
+ options |= RegexOptions.IgnoreCase;
+ }
+
+ if (ignoreWhitespace)
+ {
+ options |= RegexOptions.IgnorePatternWhitespace;
+ }
+
+ if (singleline)
+ {
+ options |= RegexOptions.Singleline;
+ }
+
+ if (multiline)
+ {
+ options |= RegexOptions.Multiline;
+ }
+
+ if (rightToLeft)
+ {
+ options |= RegexOptions.RightToLeft;
+ }
+
+ return options;
+ }
+
+ private static IUIDataGridRow CreateCheatSheetRow(string syntax, string description, string details)
+ => Row(
+ null,
+ details: Label().Text(details),
+ Cell(
+ Label()
+ .NeverWrap()
+ .Text(description)),
+ Cell(
+ Label()
+ .NeverWrap()
+ .Style(UILabelStyle.BodyStrong)
+ .Text($"\t{syntax}\t")));
+
+ private static IUIDataGridRow CreateCheatSheetTitleRow(string title)
+ => Row(
+ null,
+ Cell(
+ Label()
+ .NeverWrap()
+ .Style(UILabelStyle.Subtitle)
+ .Text(title)),
+ Cell(Label()));
+}
diff --git a/src/spellcheckerexclusion.dic b/src/spellcheckerexclusion.dic
index 7750f71ee..7bf7bf360 100644
--- a/src/spellcheckerexclusion.dic
+++ b/src/spellcheckerexclusion.dic
@@ -21,3 +21,5 @@ Blazor
Brettel
bgra
colorblindsimulator
+Ecma
+singleline