When I read Joe Gregorio’s sregex: Structural Regular Expressions in Python last October I thought porting his code to C# would provide an interesting exercise in C# functional style coding. Structural regular expressions were originally described in a paper by Rob Pike (available here ). Joe’s sregex project page describes like this:
Structural regular expressions work by describing the shape of the whole string, not just the piece you want to match. Each pattern is a list of operators to perform on a string, each time constraining the range of text that matches the pattern. Examples
will make this much clearer.
The first operator to consider is the x// operator, which means e(x)tract. When applied to a string, all the substrings that match the ...
Content suppressed by ://URLFAN, for full article visit source