3 ms·
I would like to point out that I am actually the creator of this idea, and not the author. The author has created a variation in C#, that has some differences.
by BobTurbo 13y ago
I would like to point out that I am actually the creator of this idea, and not the author. The author has created a variation in C#, that has some differences.
The original repository is at:
https://github.com/thebinarysearchtree/RegExpBuilder https://github.com/thebinarysearchtree/RegExpBuilder
I came up with this idea 2 years ago. Some differences I see between my idea and this c# implementation are:
Or() is confusing by itself. In mine, you pass in objects or strings, such as:
var regex = new RegExpBuilder()
.either(pattern1)
.or(pattern2);
var regex = new RegExpBuilder()
.either("sometime")
.or("soon")
.or("never");
Also, all the special characters are escaped properly (\ is not escaped).
There are shortcuts - you don't have to do
.exactly(1).of("hackernews")
you can just do:
.then("hackernews");
In terms of differences between this and VerbalExpressions, verbal expressions is very limited. It cannot represent many quantifiers (eg, at least 3 of something), does not have decent ways to group subexpressions, and so on. It can only represent (in a practical way), about 0.000001 % of regular expressions, as opposed to RegExpBuilder.
- dyml 13y agoYou have my support! I read a blogpost showing off your RegExpBuilder and I got inspired to create something similiar (as a chance to improve my regex and coding skills)in C#, although I have some things I would love to do differently than how your lib does it. Thank you for a great library, after I have reached stable with this C# port, i'd like to create a TypeScript version. I hope you do not have anything against me writing spinnofs? :)