InvalidOperationException: A highlighting span matched 0 characters, which would cause an endless loop. Change the highlighting definition so that either the start or the end regex matches at least one character. Start regex: (?<=([^\\]|^)(\\\\)*)(?=\\) End regex: ($|(?<=\\.) ) StackTrace: at ICSharpCode.AvalonEdit.Highlighting.HighlightingEngine.HighlightLineInternal() at ICSharpCode.AvalonEdit.Highlighting.HighlightingEngine.HighlightLine(IDocument document, IDocumentLine line) at ICSharpCode.AvalonEdit.Highlighting.DocumentHighlighter.HighlightLine(Int32 lineNumber) at ICSharpCode.AvalonEdit.Highlighting.HighlightingColorizer.ColorizeLine(DocumentLine line) at ICSharpCode.AvalonEdit.Rendering.DocumentColorizingTransformer.Colorize(ITextRunConstructionContext context) at ICSharpCode.AvalonEdit.Highlighting.HighlightingColorizer.Colorize(ITextRunConstructionContext context) at ICSharpCode.AvalonEdit.Rendering.ColorizingTransformer.Transform(ITextRunConstructionContext context, IList`1 elements) at ICSharpCode.AvalonEdit.Rendering.VisualLine.RunTransformers(ITextRunConstructionContext context, IVisualLineTransformer[] transformers) at ICSharpCode.AvalonEdit.Rendering.TextView.BuildVisualLine(DocumentLine documentLine, TextRunProperties globalTextRunProperties, VisualLineTextParagraphProperties paragraphProperties, VisualLineElementGenerator[] elementGeneratorsArray, IVisualLineTransformer[] lineTransformersArray, Size availableSize) at ICSharpCode.AvalonEdit.Rendering.TextView.CreateAndMeasureVisualLines(Size availableSize) at ICSharpCode.AvalonEdit.Rendering.TextView.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)