
I wrote:
John Maddock
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)