Java regular expression for the IP range matching problem
Posted on 2011-03-23
I need a regular Java regular expression for the below problem. I have some list of ip address ranges as patterns in a text file. How extract the matched ip addresses from the given bulk string data.
For example the text file contains:
The given String:
Experts are ready to help solve your problem. The quality of your question will directly influence the speed and accuracy of the answers you receive.The given ip address is 126.96.36.199 and also it may be 188.8.131.52.
This is the next line of text and which contains the following ip address 184.108.40.206 and this should not match.
This is the third line and which contains 61.78 4.9 this also should not match. But this should match.220.127.116.11
Here 18.104.22.168 contains 22.214.171.124 but its not valid ip, so it should not match.
Thanks in advance.