1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-08-18 20:41:29 +02:00

Merge pull request #4442 from nbehrnd/pt-br-awk

[AWK/pt-br] correct example gsub
This commit is contained in:
Marcel Ribeiro Dantas, Ph.D
2022-07-11 20:24:56 +02:00
committed by GitHub

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