Merge pull request #4441 from nbehrnd/awk-es

correct example of gsub in awk-es
This commit is contained in:
Marcel Ribeiro Dantas, Ph.D 2022-07-11 20:25:27 +02:00 committed by GitHub
commit eb992cefa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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