correct example gsub in zh-cn-awk

Edit based on the correction of the English original.[1]

[1] https://github.com/adambard/learnxinyminutes-docs/pull/4437
This commit is contained in:
Norwid Behrnd 2022-07-11 15:13:35 +02:00
parent 1ff2927250
commit dbcaa68877

View File

@ -179,7 +179,7 @@ function string_functions( localvar, arr) {
# 都是返回替换的个数
localvar = "fooooobar"
sub("fo+", "Meet me at the ", localvar) # localvar => "Meet me at the bar"
gsub("e+", ".", localvar) # localvar => "m..t m. at th. bar"
gsub("e", ".", localvar) # localvar => "m..t m. at th. bar"
# 搜索匹配正则的字符串
# index() 也是搜索, 不支持正则