Permalink
Browse files

Update README to include c# syntax highlighing.

  • Loading branch information...
1 parent 6114c04 commit e570bff75d80374fa6bf6a18db81f67ded2a0dee @bfriesen bfriesen committed Jan 14, 2013
Showing with 19 additions and 17 deletions.
  1. +19 −17 README.md
View
@@ -4,29 +4,31 @@ RegExpose is a regular expression engine that exposes its inner-workings. It is
#####Usage:
- // Create a regex compiler with default options.
- RegexCompiler compiler = new RegexCompiler();
+```c#
+// Create a regex compiler with default options.
+RegexCompiler compiler = new RegexCompiler();
- // Compile a regex that searches for "foo" followed by an optional "bar".
- Regex regex = compiler.Compile("foo(?:bar)?");
+// Compile a regex that searches for "foo" followed by an optional "bar".
+Regex regex = compiler.Compile("foo(?:bar)?");
- // Create an engine that parses "foobar".
- RegexEngine engine = regex.Parse("foobar");
+// Create an engine that parses "foobar".
+RegexEngine engine = regex.Parse("foobar");
- // Get a list of the steps that the engine takes while parsing its input.
- // Note that the result is lazily evaluated, and you can perform LINQ queries on it.
- IEnumerable<ParseStep> steps = engine.GetParseSteps();
+// Get a list of the steps that the engine takes while parsing its input.
+// Note that the result is lazily evaluated, and you can perform LINQ queries on it.
+IEnumerable<ParseStep> steps = engine.GetParseSteps();
- // Get the first match found in the input string.
- // Note that the RegExpose.Match class mimics the System.Text.RegularExpressions.Match class.
- Match match = engine.GetMatch();
+// Get the first match found in the input string.
+// Note that the RegExpose.Match class mimics the System.Text.RegularExpressions.Match class.
+Match match = engine.GetMatch();
- // Get a collection of all matches. The collection is lazily evaluated.
- IEnumerable<Match> matches = engine.GetMatches();
+// Get a collection of all matches. The collection is lazily evaluated.
+IEnumerable<Match> matches = engine.GetMatches();
- // Replaces all matches from the input string with "quxbaz".
- // Like the System.Text.RegularExpressions.Regex.Replace method, this has several overloads.
- string replacement = engine.Replace("quxbaz");
+// Replaces all matches from the input string with "quxbaz".
+// Like the System.Text.RegularExpressions.Regex.Replace method, this has several overloads.
+string replacement = engine.Replace("quxbaz");
+```
###UI

0 comments on commit e570bff

Please sign in to comment.