-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Following expression: (?<First>(?:2[0-4]\d|25[0-5]|[01]?\d\d?))\.(?<Second>(?:2[0-4]\d|25[0-5]|[01]?\d\d?))\.(?<Third>(?:2[0-4]\d|25[0-5]|[01]?\d\d?))\.(?<Fourth>(?:2[0-4]\d|25[0-5]|[01]?\d\d?))
My result:
var ipAdress = new Magex().Alternative(
Magex.New()
.Character('2')
.CharacterIn('0', '-', '4')
.CharacterIn(Characters.Numeral),
Magex.New()
.String("25")
.CharacterIn('0', '-', '5'),
Magex.New()
.CharacterIn('0', '1').Repeat.AtMostOnce()
.CharacterIn(Characters.Numeral)
.CharacterIn(Characters.Numeral).Repeat.AtMostOnce());
var expression = new Magex().CaptureAs("First", _ipAdress)
.Character('.')
.CaptureAs("Second", ipAdress)
.Character('.')
.CaptureAs("Third", ipAdress)
.Character('.')
.CaptureAs("Fourth", ipAdress);Is there a way to use the enums of Characters directly without encapsulating them inside a CharacterIn call? Getting \d instead of [\d]?
Metadata
Metadata
Assignees
Labels
No labels