-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for special groups? #1
Comments
Hi Birgos, good ideas! I am not sure how to beam it into the language in an elegant manner though. I don't think adding new high-level functions like magicWand.Group(x => x, GroupOptions.ExcludePrefix);
//Snip
enum GroupOptions
{
Balancing = 0,
ExcludeSuffix,
ExcludePrefix,
MatchMissingSuffix,
MatchMissingPrefix,
GreedySubexpression,
Comment
} I'm not so up to date with those constructs, can they be combined with named groups and other "elaborated" functions just with standard groups? |
Hi! [Test]
public void MagicExpression_SpecialGroups()
{
const string regExpression = @"^(?!.*[\.]{2,}.*)$";
var result = magicExpression
.StartOfLine()
.MatchIfSuffixIsAbsent(x => x.Character().Repeat.Any()
.CharacterIn('\\', '.') // produces multiple backslashes? should be equal to [\.]
.Repeat.Between(2) // here we would need an overload to accept missing parameter
.Character().Repeat.Any()
.EndOfLine());
Assert.That(result.Expression.ToString(), Is.EqualTo(regExpression));
} Sometimes I have used the following tool for deciphering. Maybe you can have a look? (http://www.ultrapico.com/expresso.htm) Sorry, but unfortunately, I have not properly understood your last question :-( |
Hello,
after trying this framework i missed the support for the following special group functionality:
Example regex expression that i wanted to rewrite:
^(?!.*[\.]{2,}.*)[a-zA-Z0-9_%\&ß'+-]+((([a-zA-Z0-9_%.\&ß'+-]))*[a-zA-Z0-9_%\&ß'+-]+)?@(?:[a-zA-Z0-9üöäÜÖÄ-]+\.)+[a-zA-Z]{2,4}$
The text was updated successfully, but these errors were encountered: