1

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
  • 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.

Sebastian Hoffmann
  • 11,127
  • 7
  • 49
  • 77

1 Answers1

0

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

Churk
  • 4,556
  • 5
  • 22
  • 37