RegEx - Exception on faulty RE, or other report of failure.

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). Regards, Richard. Richard Kerry BNCS Engineer Siemens IT Solutions and Services Ltd The Business Technologists Room 457 Drama Building, BBC Television Centre, Wood Lane, London, W12 7RJ T: +44 (0)20 82259063 F: +44 (0)20 8576 8182 M: +44 (0)7921 244993 Email: richard.kerry@siemens.comblocked::mailto:richard.kerry@siemens.com Website: www.siemens.co.uk/it-solutionsblocked::outbind://47/www.siemens.co.uk/it-solutions This e-mail contains confidential information and is for the exclusive use of the addressee/s. If you are not the addressee, then any distribution, copying or use of this e-mail is prohibited. If received in error, please advise the sender and delete it immediately. We accept no liability for any loss or damage suffered by any person arising from use of this e-mail. Siemens IT Solutions and Services Limited Registered No: 1203466 England Registered Office: Faraday House, Sir William Siemens Square, Frimley, Camberley, GU16 8QD

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.

Thank you John. Although I know the basics of exceptions I have little experience of using them. I'll see if I can get the exception version working otherwise I'll use the flag. Appreciatively, Richard.
boost::regex e(some_string, boost::regex_constants::no_except); if(e.status) { // Ooops we have an error.... }
HTH, John.
participants (2)
-
John Maddock
-
Kerry, Richard