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 188.8.131.52 and also it may be 184.108.40.206.
This is the next line of text and which contains the following ip address 220.127.116.11 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.18.104.22.168
Here 22.214.171.124 contains 126.96.36.199 but its not valid ip, so it should not match.
Thanks in advance.