Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2001-07-26 07:44:42


On Thursday 26 July 2001 16:30, gregod_at_[hidden] wrote:

> I thought about trying to mimic some of the syntax exactly, i.e.,
> result = (str =~ s/str/fmt/g);
>
> but unfortunately we can't overload operator= for
> std::basic_String<Char, Traits>, so it isn't going to happen.
>
> The >> operator approach is reasonable. It seems to read as: "feed
> mystring into regex" and "feed mystring into regex and replace with
> myformat", respectively. I can live with that.

If similarity to perl is desired, we can try
s(string_to_process)/"foo"/"bar"/g;
syntax.

I can live with >> operator too.

-- 
Regards,
Vladimir

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk