In IIS I'm trying to setup a regular expression for the URL Rewrite module that will allow a certain an IP Range to access it, however I'm struggling on getting a regular expression to accurately work. IP addresses obviously can be multiple charters so this is what can make it hard I feel. An Example is below:
IP Value to Match:
12.345.678.198
The below will obviously match the 1st 3 sections as they are static, but I want to match the last 3 and this is the simplest way to demo what I want, but clearly will not work:
12\.345\.678.[193-254]
I've tried:
12\.345\.678.[1-2][5-9][3-4]
But that will obviously not match the last digit of 8
as it is outside of the range of [3-4]
. If I did
12\.345\.678.[1-2][0-9][0-9]
This would match an IP of 12.345.678.269
and that is outside of the range that I would require. Is this even possible with regex or is there a different better way to limit IP addresses in IIS from connecting to a certain site hosted with in that?
Many thanks in advance