- 论坛徽章:
- 0
|
回复 #1 greendays 的帖子
还得自己看看,别人讲也是看man,给你翻译一下,
gensub(r, s, h [, t]) Search the target string t for matches of the regular expression r. If h is a string beginning with g or G, then replace
all matches of r with s. Otherwise, h is a number indicating which match of r to replace. If t is not supplied, $0 is
used instead. Within the replacement text s, the sequence \n, where n is a digit from 1 to 9, may be used to indicate just
the text that matched the n'th parenthesized subexpression. The sequence \0 represents the entire matched text, as does
the character &. Unlike sub() and gsub(), the modified string is returned as the result of the function, and the original
target string is not changed. |
|