r.gsub!(/\^\{([^\}]*)\}/){"\",phantom()\^{#{$1} phantom()},\""}
r<-gsub('\\^\\{([^\\}]*)\\}',"\",phantom()^{\\1 phantom()},\"",r)