|
Boost Users : |
From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2003-10-14 08:45:10
I wrote:
> John Maddock <john_at_[hidden]> wrote:
> > > I see that Regex++ always treats ^ and $ as start and end of line
> > > rather than start and end of buffer. Perl does this only if the
> > > /m switch is used. Is there a simple way to switch between these
> > > two interpretations when compiling a regex?
> >
> > No but you can use \A and \z for that purpose.
>
> I know that, but I want to be able to interpret user-supplied regexes
> either way. Maybe I can pre-process them to substitute ^ and $, but
> that seems awkward.
Alternately I could have the traits object return different
interpretations for them, but that would require either:
- switching between two specialisations of reg_expression at run-time
(resulting in code bloat)
or
- changing reg_expression's constructors to allow the client to pass
a traits object into it rather than always using the default
constructor (unusual usage of a traits class)
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