The RegexProvider project contains a type providers for regular expressions. Documentation available here.
The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)
A type provider for regular expressions.
Home Page: http://fsprojects.github.io/FSharp.Text.RegexProvider/
License: Apache License 2.0
The RegexProvider project contains a type providers for regular expressions. Documentation available here.
The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)
Is this a provider shown by Lincoln Atkinson in this video
Does it support F# 4.0 features?
I'm getting a very frequent hang in Visual Studio 2013 when working with a source file containing multiple RegexProvider
types.
When I attached to the hung devenv, I found two threads both stuck in HashSet.Contains
, through Helper.niceName
. It looks like the HashSet has been corrupted, since the bucket being searched has a 'next' of itself.
It's a bit of guesswork, but I suspect a race condition between the two threads caused the HashSet to become corrupted due to concurrent operations from the editor or add-in, since generalTypeSet
is a non-thread-safe singleton.
When there are several matches for the pattern in the input string, those can be obtained using Matches()
instead of Match()
. This correctly returns a sequence of the provided Match
type.
However, it is also possible to get to the next match directly from a Match
instance using Match.NextMatch()
. This currently only returns System.Text.RegularExpressions.Match
, not the provided type.
I'm trying to write code that can work on several regular expressions that share common groups. In order to do that I'm trying to use static constraints and inline methods to perform "duck-typing" on the provided types. This could work, but as methods names on provided types are the same that the ones in the Regex base class type, I then get a compiler error because the correct overload of the function can't be resolved.
I'd love to have the provided methods named TypedMatch
and TypedMatches
instead of Match
and Matches
. That way, the overload resolution problem cannot happen. In order to keep backward compatibility, that could be implemented using an optional Prefix
parameter for the provider, that would change the names of the generated methods.
If the maintainers are ok with this idea in principle, I'll be pleased to do a pull-request.
How do I set Regex options, e.g. RegexOptions.IgnoreCase
?
Perhaps this should be added to the docs?
As of now this TP is not compatible with .NET Core. It would be a very nice addition if it would be made compatible with this platform as well. How much work would it be making it compile to .NET Core currently?
The Replace()
instance method of the Regex
class has overloads taking a MatchEvaluator
instance, which is a delegate with the signature Match -> string
. To benefit from the provided Match
type here, a custom MatchEvaluator
type would have to be provided, and the Replace()
overloads adjusted accordingly.
(On second thought, that's probably not even possible, but I'll leave that to those who actually have a clue about type providers.)
Missing code formatting on http://fsprojects.github.io/FSharp.Text.RegexProvider/
Running build GenerateDocs
gave this error:
System.TypeInitializationException: The type initializer for 'Microsoft.FSharp.Metadata.AssemblyLoader' threw an exception.
---> System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-PowerPack-Metadata>.$Metadata' threw an exception.
---> System.ArgumentException: could not produce an FSharpAssembly object for the assembly 'FSharp.Core' because this is not an F# assembly
Hi @dtchepak
I'm wondering if you might be able to rename this project to "FSharp.Text.RegexProvider"? And likewise the provider would be in the namespace "FSharp.Text".
If you could I'd be immensely grateful.
(The reasons are somewhat obvious but are explained in the recommended guidelines in more detail, would be happy to talk it over though!)
Best regards,
Don
Hello fellows,
It would improve the provider if typed match supports all overloads of the regular match function like specifying an offset.
If you're fine with this I would make a PR.
Running build.cmd
does not work just after running clone. The problem is that paket have not installed fsi.exe under the packages
folder.
git clone ...
build.cmd
I commented out GenerateHelp
task in the build.fsx
dependency graph.
Then
build.cmd
worked and finally
git checkout build.fsx
to verify that the build script worked after paket had installed FSI executable somewhere under the packages
folder.
This is just a heads up. Feel free to ignore this issue. I am just inspecting the Regex type provider, to learn about TP's.
The corresponding page on Nuget ( https://www.nuget.org/packages/FSharp.Text.RegexProvider ) is missing links to the github project page and the documentation page ( http://fsprojects.github.io/FSharp.Text.RegexProvider/ )
Hello again :)
So far I understood the regex class it's safe to use the complete match and it's groups if the parent match field Success is true. Moreover the same approach is used for active patterns and therefor I would like to add a tryTypedMatch function to the provider having as additional fields the value of each group.
Would you appreciate this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.