I'm not "messing" -- .assign() is a documented, public method. http://www.cplusplus.com/reference/regex/basic_regex/assign/
The pattern is supplied at run time -- as is typical of regex implementations -- so no number of subclasses solves the problem. It would conceivably be possible to pass the pattern on the ctor but that is not how the code works. I get the pattern well after ctor time. (Could I do a new instead of having it declared in the class header? Sure, I could. But why should I? I firmly believe this is a bug, and I do have a workaround, letting the flag default to ECMA.) For a given instance, the pattern can change from time to time -- should be supported by the class AFAIK. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Jack J. Woehr Sent: Sunday, April 8, 2018 4:49 PM To: [email protected] Subject: Re: Any C++ regex template class gotchas? On 4/8/2018 1:43 PM, Charles Mills wrote: > Thanks, but won't work well in the real code. Besides, the C++ way to do that is to have subclasses with increasingly specific ctors for your needs, not mess with a template's internal data in main(). Betcha if you work on the class design a little it will "magically" start working. -- Jack J. Woehr # Science is more than a body of knowledge. It's a way of www.well.com/~jax # thinking, a way of skeptically interrogating the universe www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
