I have a database and throughout the text there are some quotes that are in quotation marks. I would like to remove all the dots \".\" that are enclosed in quotation marks i
mystring <-'"é preciso olhar para o futuro. vou atuar" no front em que posso
fazer alguma coisa "para .frente", disse jose.'
You can use the following pattern
with gsub
:
gsub('(?!(([^"]*"){2})*[^"]*$)\\.', "", mystring, perl = T)
Same with stringr
:
str_replace_all(mystring, '(?!(([^"]*"){2})*[^"]*$)\\.', '')
Output:
#> "é preciso olhar para o futuro vou atuar" no front em que posso
#> fazer alguma coisa "para frente", disse jose.