Boost logo

Boost :

Subject: [boost] [regex] [1.35]Problem with IPV6 validation windows XP
From: Gopal_Haldar_at_[hidden]
Date: 2008-10-16 06:31:03


 passing any IPV6 IP
But it is failed to validate ::ffff:12.12.12.12 format...
Please see my code...

bool IsValidIPv6String(wstring ipv6address)
{
        wsmatch what;
        
        wregex
expression(L"^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,
4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0
-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa
-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,
4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|((
[0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b)
\\.){3}(\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b))|(([0-9A-Fa-f]
{1,4}:){0,5}:((\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b)\\.){3}(
\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:
){0,5}((\b((25[0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b)\\.){3}(\b((25[
0-5])|(1\\d{2})|(2[0-4]\\d)|(\\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa
-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{
1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$");
        
        if(regex_match(ipv6address, what, expression))
        {
      // what[0] contains the whole string
      // what[1] contains the response code
      // what[2] contains the separator character
      // what[3] contains the text message.
      //if(msg)
       // msg->assign(what[3].first, what[3].second);
          
          return true;
      
        }
        

        return false;
}

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of John Maddock
Sent: Thursday, October 16, 2008 2:30 PM
To: boost_at_[hidden]
Subject: Re: [boost] [regex] [1.35]Problem with IPV6 validation windows
XP

Gopal_Haldar_at_[hidden] wrote:
>>> Hi
>>> I am using the regex library for checking the IPV6 validation.
>>> Same expression I am using for javascript regular expression
>>> verification.
>>> But for IP format ::ffff:12.12.12.12 javascript regex api returing
>>> valid IP and boost regex_match method returning invalid IP(Windows
>>> XP).
>>> Please help me to identify the problem.

You're going to have to provide much more information:

The exact regular expression used,
The string you're matching against,
and if possible the code you're using.

Thanks, John.
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk