mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
Merge pull request #4441 from nbehrnd/awk-es
correct example of gsub in awk-es
This commit is contained in:
commit
eb992cefa6
@ -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