fsprojects/RegexProvider — pull request #2 by dtchepak (2014-02-22 12:36:51+00:00)
Title: Added Matches method (take 2)

Trying again after my terrible first attempt at this patch...

The idea is to expose the [Regex.Matches](http://msdn.microsoft.com/en-us/library/e7sf90t3(v=vs.110).aspx) method in a way that gives access to captured groups for each match so we can map, filter etc with strongly-typed property accessors (like we do for a single match using the existing type provider `Match` method).

The added test in this commit shows a regex that will match a phone number anywhere in a string. It gets all the `Matches` then picks out the area code of each.

The problem with my first attempt at this was I forgot `MatchCollection` doesn't implement `IEnumerable`, so property accessors tried to get `Groups` from `Object` instead of `Match` (oops). I've fixed it this time using `Seq.cast`.

I've been able to build on Windows/MS CLR (using `build.cmd`) and pass all the tests (Works On My Machine™), but I'm having trouble getting the build working on Mac/Mono so I haven't been able to test it there.

Please have a look and check it makes sense (I've only just started looking at type providers so not sure if I'm doing it wrong). If you're happy to merge it in then I'll push up a new nuget package.