Loganathan Natarajan
asked on
How do i generate Ip addresses from Regular Expression
I am getting Regular Expression as an input for IP Address. ex. 192.168.(2[0-4]\d|25[0-5]| [01]?\d\d? ).\.(2[0-4 ]\d|25[0-5 ]|[01]?\d\ d?). Having this, i need to generate list of IP Addresses starting from 192.168.1.1 to 192.168.254.254. How could i achieve this in C#.NET.
Could anybody help?
Thanks in advance..
Could anybody help?
Thanks in advance..
ASKER
I am doing a program that will fetch the name of the computers available over a network. In order to get the computer name i need to provide the Ip address. There are many subnets available over the network. It is very difficult to enter all the IP addresses.
So, i thought i could use Regular Expression to avoid this difficulty.
I thought this could be generalized and used for any network.
So, i thought i could use Regular Expression to avoid this difficulty.
I thought this could be generalized and used for any network.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks for the question and the points.
Note that . chars need to be escaped in regex patterns, as you did in one place but not the others, also in the one place where you did escape the . you seem to have an extra unescaped . before it.