Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-05-10 05:01:01


Bruno Voigt wrote:
> Hi John,
> At first thanks again for fast response, your lib is one of my most
> precious tools.
>
> To follow your argumentation I wrote two perl oneliners to reproduce
> it and saw that only the first version with the greedy flag matches
> the boost-1.33 behaviour
> whilest the second version matches that of the <boost-regex-1.33
> behaviour. Is there a way to get the non greedy style with
> boost-regex-1.33 ?
>
> $ perl -e '$s="123";$s=~s/(.*)/+$1/g;print $s;'
> +123+
>
> $ perl -e '$s="123";$s=~s/(.*)/+$1/;print $s;'
> +123

The /g modifier signifies that search and replace should be global (replace
all occurances), without it only the first occurance is replaced. If that's
what you want to happen pass "format_first_only" as a match-flag to
regex_replace/regex_merge.

HTH, John.


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