[SOLVED] [Regex matching IP-Ranges] looking for alternative software solution
by Michael Uplawski from LinuxQuestions.org on (#5KTWW)
https://www.analyticsmarket.com/freetools/ipregex/
is throwing security alerts in my browser, and a different site which proposes the exact same tool does alike.
I know however that both are functional and turn an IP-range like
13.64.0.0 - 13.107.255.255
into a regular expression, matching *each included* IP-address, thus answering to the question: Is an address in the range?"
The problem of writing such a tool is summarized on https://ihateregex.io/expr/ip/ The example is though for only 1 address or for a literal range, i.e. the String "13.64.0.0 - 13.107.255.255", thus answering to Is this an address or a range?"
I once have given it a try but made the mistake to talk about it in German newsgroups. Anyway - apart from some bruises and psychic trauma -, I got away with a recipe and the conclusion that each nibble of an address must be handled separately. This occupied me for a while but I gave up.
As each ip-range can express its limits in any one of the four nibbles, a global solution is almost impossible. Hence the need to generate a distinct Regexp for each range. A programmatic solution which worked with arithmetic, would have to be coded anew for each IP-range or would have to be parameterized in a rather complicated way.
That analyticsmarket.com" features exactly the tool that I am after should not surprise me, although I want to use it in a way exactly contrary to their intentions.
Question: Do you know of a standalone software or trustworthy online-application which handles complete IP-ranges and turns them into a regular expression?
is throwing security alerts in my browser, and a different site which proposes the exact same tool does alike.
I know however that both are functional and turn an IP-range like
13.64.0.0 - 13.107.255.255
into a regular expression, matching *each included* IP-address, thus answering to the question: Is an address in the range?"
The problem of writing such a tool is summarized on https://ihateregex.io/expr/ip/ The example is though for only 1 address or for a literal range, i.e. the String "13.64.0.0 - 13.107.255.255", thus answering to Is this an address or a range?"
I once have given it a try but made the mistake to talk about it in German newsgroups. Anyway - apart from some bruises and psychic trauma -, I got away with a recipe and the conclusion that each nibble of an address must be handled separately. This occupied me for a while but I gave up.
As each ip-range can express its limits in any one of the four nibbles, a global solution is almost impossible. Hence the need to generate a distinct Regexp for each range. A programmatic solution which worked with arithmetic, would have to be coded anew for each IP-range or would have to be parameterized in a rather complicated way.
That analyticsmarket.com" features exactly the tool that I am after should not surprise me, although I want to use it in a way exactly contrary to their intentions.
Question: Do you know of a standalone software or trustworthy online-application which handles complete IP-ranges and turns them into a regular expression?