Boost logo

Boost Users :

From: canx11 (canx11_at_[hidden])
Date: 2007-11-24 07:12:21


On Friday 23 November 2007, Jin Sun wrote:
> link with  -lboost_regex-gcc41-1_34_1
>
> --
> Jin Sun

Hello Jin,

thank you for the good tip...that closed my issue. I first tried the flag with
c++ compiler from command line which succeeded and search around in the
project options of kdevelop where I then set the linker flags as well and
then it also worked from the ide.

Now i was able to add the regex functionality to my header file where i have a
method that checks with boost::regex_match wether a passed string argument is
a valid IP address and it works fine. Here is the short snippet:

  bool IpValid(string strIpAddress){
    string strPattern = "\\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|
2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25
[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b";
    regex regExpression(strPattern);
    return regex_match(strIpAddress,regExpression);
  };

Best regards,

Jan


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net