Boost logo

Boost Users :

Subject: Re: [Boost-users] RegEx - Exception on faulty RE, or other report of failure.
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-03-22 06:29:49


>Using Boost Regex for the first time I note that if there is an error in
>the syntax of the RE given then an exception is raised.
>
>Is this the only way of checking the RE syntax ?
>Or is there a function that I can call which can validate it for me without
>an exception.
>I don't see anything in the documentation (I'm using Boost 1.4 as I need to
>use it with Visual C++ 6).

boost::regex e(some_string, boost::regex_constants::no_except);
if(e.status)
{
  // Ooops we have an error....
}

HTH, John.


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