O vi command %s/\([a-z]\),\([A-Z]\)/ /g mudará
y,S
T,d
5,e
em
y S
T,d
5,e
Estou tentando editar um arquivo de texto usando vi , onde quero substituir as correspondências de [a-z] , [A-Z] por:
{matching value of [a-z]}{a space instead of a comma}{matching value of [A-Z]}.
Por exemplo: Bourbon,Glazed,Turkey,
seria substituído por: Bourbon Glazed Turkey,
Eu estava pensando em usar o agrupamento & referência de volta? Mas ainda não percebi isso.
O vi command %s/\([a-z]\),\([A-Z]\)/ /g mudará
y,S
T,d
5,e
em
y S
T,d
5,e
$ echo 'Bourbon,Glazed,Turkey,' | sed 's/\([a-z]\),\([A-Z]\)/ /g'
Bourbon Glazed Turkey,
$
Portanto, em vi é o mesmo:
:%s/\([a-z]\),\([A-Z]\)/ /g
Tags vi regular-expression