
10 Apr
2008
10 Apr
'08
2:36 p.m.
mitya@stamford:~$ perl -e '$in = "1111"; $in =~ s/(.*)/0$1/; print $in."\n"' 01111 mitya@stamford:~$ The s/... construct by default replaces only the first match. You need to set the corresponding flag in your code: http://www.boost.org/doc/libs/1_35_0/libs/regex/doc/html/boost_regex/ref /regex_replace.html "If the flag format_first_only is set then only the first occurrence is replaced [...]"