Boost logo

Boost Users :

Subject: Re: [Boost-users] Help a novice today getting started with regex.hpp
From: gast128 (gast128_at_[hidden])
Date: 2013-01-19 06:40:55


Neil Sutton <neilmsutton <at> gmail.com> writes:

> Please can someone tell me the best place to start studying how to write and
use boost::regex.hpp?
> Is there any documentation or tutorial that is easier for a novice to
understand than the standard distribution documentation?

Very simple case:

#define BOOST_ALL_DYN_LINK

#include <boost/regex.hpp>

void Test()
{
   boost::regex rgx("12*");
   bool b = false;

   b = boost::regex_match("12", rgx);
   b = boost::regex_match("12222", rgx);
   b = boost::regex_match("11", rgx);
}

If u get linking errors, pleace check my article on www.codeproject.com. For
syntax of regex's (and their different flavours) probably the O' Reilly book is
worth while. But perhaps above example was too simple?


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