[awk] Fix wrong example output (in all languages) (#4750)

This commit is contained in:
Adrien LUDWIG 2023-09-08 05:27:46 +00:00 committed by GitHub
parent 30dc33fbcd
commit 62b5f91d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -209,7 +209,7 @@ function string_functions( localvar, arr) {
# Both return number of matches replaced
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"
# Search for a string that matches a regular expression
# index() does the same thing, but doesn't allow a regular expression

View File

@ -196,7 +196,7 @@ function string_functions( localvar, arr) {
# Ambas regresan el número de matches remplazados.
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"
# Buscar una cadena que haga match con una expresión regular
# index() hace lo mismo, pero no permite expresiones regulares

View File

@ -217,7 +217,7 @@ function string_functions( localvar, arr) {
# Les deux renvoient le nombre de correspondances remplacées
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"
# Rechercher une chaîne de caractères qui correspond à une expression
# régulière index() fait la même chose, mais n'autorise pas les expressions

View File

@ -202,7 +202,7 @@ function string_functions( localvar, arr) {
# Ambas retornam o número de instâncias substituídas
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"
# Localiza um texto que casa com uma expressão regular
# index() faz a mesma coisa, mas não permite uma expressão regular

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