sed -i -e '/^global_filter/{\|"r/\.\*/"|s|.*|global_filter = [, "r/.*/"]|;}' data
Explicação
sed -i -e '
# look at only lines that begin with global_filter
/^global_filter/{
# and also they should contain the string "r/.*/"
# change everything to the following expression
\|"r/\.\*/"| s|.*|global_filter = [, "r/.*/"]|
## alternatively could be written:
#\|"r/\.\*/"|c\
#global_filter = [, "r/.*/"]
}
' data