• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to validate Ipv6Address  RSS feed

 
Abhra Kar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a String variable containing "10b3:0:0:0:0:0:0:0 ", i want to check it is a Ipv6Address or not .
Please help me how I can do this .
Thanks in Advance.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhra Kar wrote:I have a String variable containing "10b3:0:0:0:0:0:0:0 ", i want to check it is a Ipv6Address or not .

I'm not sure what you're asking.

Do you mean that you want to verify that its format is correct?
Or do you want to actually validate the address itself (eg, via a ping)?

Winston
 
Abhra Kar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah I want to verify it's format in both jdk 5 and 6

Thanks
Abhra
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhra Kar wrote:Yeah I want to verify it's format in both jdk 5 and 6

I suspect a regex will be your man; and this page claims to have one that covers all valid addresses.

However, it's an absolute brute; and I sure as hell wouldn't want to be the one that had to explain it if things go TU.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!