This is a viewer only at the moment see the article on how this works.
To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk
This is a preview from the server running through my markdig pipeline
Wednesday, 28 January 2004
Pretty clever little function...can't think of a use for it right now :-)
I'm currently writing a series of articles (that will hopefully get published ) titled "Regex Reminders" that will provide dozens of code snippets that demonstrate how to perform common - and some not-so-common - operations using regex.
In the first article titled "Replacing" I came up with a script that shows how to highlight a word when NOT found within another piece of text. The following code snippet highlights that...
Match "foo" not in ANCHORS using MatchEvaluator
[C#] string source = sourceTextBox.Text ; Regex re = new Regex( @"(?'Url'<a [^>]*>.*?</a>)|(?'theWord'foo)" ) ; // use a MatchEvaluator with a pointer to the delegate method string result = re.Replace( source, new MatchEvaluator( FormatLinkBits ) ) ;
// delegate method private string FormatLinkBits( Match m ) { if( m.Groups["theWord"].Success ) { string theWord = m.Groups["theWord"].Value ; return "<b>" + theWord + "</b>" ; } else return m.Value ; }
This would be useful for things like turning words into hyperlinks - similar to the "KeyWords" feature that ScottW recently implemented into version 0.94 of .Text.
© 2025 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.