jsakamoto / ipaddressrange

.NET Class Library for range of IP address, both IPv4 and IPv6.
Mozilla Public License 2.0
368 stars 71 forks source link

Begin - End range string throws "Unknown IP range string" String.FormatException #8

Closed pr3sidentspence closed 9 years ago

pr3sidentspence commented 9 years ago

(Please forgive total Noobery)

An attempt to call IPAddressRange.Parse as follows produces String.FormatException "Unknown IP range string."

var range1 = IPAddressRange.Parse("172.24.56.7–172.24.56.126");

pr3sidentspence commented 9 years ago

Ok, I found the problem, I was using a "-" and it accepts a "-". I have no idea what the difference is. I was typing using the minus key and it didn't like that. Copying from your example works, and the dash is shorter somehow.

jsakamoto commented 9 years ago

Ok, it's easy to also support "dash"(0x2013). (it needs bit change in regular expression, few character types.)

What do you think about we should be support both "hyphen (-)" (0x002D) and "dash (–)" (0x2013), or not?

pr3sidentspence commented 9 years ago

If you can, I would suggest doing it. Turns out I want wasn't typing it wrong, but got them when I copied from an old classic asp script.

jsakamoto commented 9 years ago

I did it :smile:

https://twitter.com/jsakamoto/status/583242492033654784