Suppose I have some text like this,
text<-c(\"[McCain]: We need tax policies that respect the wage earners and job creators. [Obama]: It\'s harder to save
Here'a another approach:
library(qdap) bracketX(text, "square")