Added support for "format_first_only" new format flag

[SVN r10119]
This commit is contained in:
John Maddock
2001-05-17 11:55:55 +00:00
parent f466b2ad2a
commit 04b11fdd1c
7 changed files with 421 additions and 373 deletions

View File

@ -33,7 +33,8 @@ enum format_flags_t{
format_sed = match_max << 1, // sed style replacement.
format_perl = format_sed << 1, // perl style replacement.
format_no_copy = format_perl << 1, // don't copy non-matching segments.
format_is_if = format_no_copy << 1 // internal use only.
format_first_only = format_no_copy << 1, // Only replace first occurance.
format_is_if = format_first_only << 1 // internal use only.
};
namespace re_detail{
@ -468,7 +469,7 @@ public:
oi_assign(out, re_copy_out(*out, iterator(m[-1].first), iterator(m[-1].second)));
oi_assign(out, _reg_format_aux(*out, m, f, flags, *pt));
*last = m[-2].first;
return true;
return flags & format_first_only ? false : true;
}
};