From b92de42c775ab615e2dd49aff0b66da4c2c31be4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 31 May 2018 17:33:35 +0300 Subject: Improve description of gensub(). --- doc/gawk.texi | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/gawk.texi') diff --git a/doc/gawk.texi b/doc/gawk.texi index 0d4c49a3..bd4033a3 100644 --- a/doc/gawk.texi +++ b/doc/gawk.texi @@ -17955,11 +17955,12 @@ a[3] = "middle" @cindex substitute in string Search the target string @var{target} for matches of the regular expression @var{regexp}. If @var{how} is a string beginning with -@samp{g} or @samp{G} (short for ``global''), then replace all matches of @var{regexp} with -@var{replacement}. Otherwise, @var{how} is treated as a number indicating -which match of @var{regexp} to replace. If no @var{target} is supplied, -use @code{$0}. It returns the modified string as the result -of the function and the original target string is @emph{not} changed. +@samp{g} or @samp{G} (short for ``global''), then replace all matches +of @var{regexp} with @var{replacement}. Otherwise, treat @var{how} +as a number indicating which match of @var{regexp} to replace. Treat +numeric values less than one as if they were one. If no @var{target} +is supplied, use @code{$0}. Return the modified string as the result +of the function. The original target string is @emph{not} changed. @code{gensub()} is a general substitution function. Its purpose is to provide more features than the standard @code{sub()} and @code{gsub()} -- cgit v1.2.3