I have a IPv4 address which should be compared against a pattern. A pattern can either be a specific address maybe containing wildcards or a dns.
- *
- ..*.*
- 192.168.*.5
- 206.0.3.4-25
- 45.30.9.101
- http://www.google.de
I already figured out that the InetAddress/Inet4Address class is the right one. But i cant figure out how to use it with both dns and wildcards. I get pattern and address as strings.
trying using a regular expression.
For numbers (\d{1,3},\d{1,3},\d{1,3},\d{1,3})
For domain, just google regular expression to match domain URL