Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Weeding out Hexadecimal IP address

Reply
Thread Tools

Weeding out Hexadecimal IP address

 
 
Slain
Guest
Posts: n/a
 
      12-12-2007
I need to validate to ensure that the user is not entering IP address
in Hexadecimal form. Is there some way to check for it?

The user would probably enter it in 0x form. Hence the only solution
which comes to my mind is to look for 'x' int the string and if so
declare it invalid. Any other ideas?

Thanks
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      12-12-2007
Slain wrote:
> I need to validate to ensure that the user is not entering IP address
> in Hexadecimal form. Is there some way to check for it?


The usual and the simplest way is to try converting and if it fails,
tell the user (and ask to re-enter).

> The user would probably enter it in 0x form. Hence the only solution
> which comes to my mind is to look for 'x' int the string and if so
> declare it invalid. Any other ideas?


I am not sure I grasp your 'x' idea...

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
get object by hexadecimal address in jstack xeon123 mailinglist Java 0 08-10-2011 07:42 AM
get object by hexadecimal address in jstack xeon123 mailinglist Java 0 08-10-2011 07:40 AM
Hexadecimal formatting with leading zeros?! Dmitry Bond. ASP .Net 1 10-13-2005 08:55 AM
Weeding out duplicates ProudMonkeyBiz Digital Photography 21 10-05-2005 11:20 AM
help - regex validator expression not weeding out commas Mad Scientist Jr ASP .Net 3 06-21-2004 07:37 AM



Advertisments