Merge pull request #4443 from nbehrnd/zn-cn-awk

[AWK/zh-cn] correct example gsub
This commit is contained in:
Marcel Ribeiro Dantas, Ph.D 2022-07-11 20:25:13 +02:00 committed by GitHub
commit a8e6e749ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() 也是搜索, 不支持正则