Bringing an end to the posts on decompositions of numeric ranges into validating regular expressions.
I've posted quite a few items covering the process of decomposition. Most of the examinations are textual only and cover the process of generating decompositions by hand. I've since issued a challenge for the creation of an algorithm that would automatically handle a given range and return the decomposition in regular expression format that could be used to validate input in the range. I talked through a sample algorithm that had some issued, then covered these issues, and finally posted my own algorithm in C# that creates a matching alternation group that isn't minimally sized, but works for the give range. Have a look.
The Beginning: Value range parsing using Regular Expressions. Breaking down the dotted decimal IP byte processing.
Follow-up on ranges: 0 through N ranges are interesting, but what about M through N ranges.
Some Oddities that are hard to handle: That range algorithm was more difficult than I originally pointed out due to some strange oddities.
The post reference the article and algorithm: An Algorithm has been prepared, I'm linking it into an article so you don't have to look at it if you don't want. It is a spoiler.