1
Vote

Extension Method :: Range()

description

The ability to take a given Regex and filter it by a particular upper and lower boundary range expressed purely in a Regular Expression. This is certainly a feature that depends upon a number of other features including GreaterThan(), LessThan(), GenerateClassSegment(), etc.
 
However, consider the complexity, and visual simplicity of the following proposed usage:
 Regex localIPRange = companyIPs.Range("192.168.1.1", "192.168.1.10");     // Filters down the company IP list to a range of x.x.x.1-10
 
Or a simpler case:
Regex areaCode = new Regex("\d{3}").Range("100", "999");

comments