mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 20:34:32 +03:00
correct example of gsub in awk-es
Edit is based on the correction in the English edition.[1] [1] https://github.com/adambard/learnxinyminutes-docs/pull/4437
This commit is contained in:
parent
1ff2927250
commit
0b6ac01abe
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user