regex - Removing contents of bracelets -


we have free text:

sal{del{rf}ghladfs}wds{w12rf}qq   

output should be:

salwdsqq 

please share various approaches if possible. example : lapply, gsub, for/while loop, grep

this works in r

string1 <- "sal{del{rf}ghla}dfs}wds{w12rf}qq" string2 <- gsub("{[^{}}]*}", "", string1, perl = true) string3 <- gsub("{.*}", "", string2, perl = true) string3 

Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -