[R] gsub regexp question

From: Phillimore, Albert <albert.phillimore_at_imperial.ac.uk>
Date: Sat 27 Jan 2007 - 20:41:20 GMT

Dear R Users,  

I am trying to users gsub to remove multiple cases of square brackets and their different contents in a character string. A sample of such a string is shown below. However, I am having great difficulty understanding regexp syntax. Any help is greatly appreciated.  


"tree STATE_286000 [&lnP=-12708.453945423369] = [&R] ((((((15[&rate=0.009761226401396686]:7.040851727747465,17[&rate=0.011500289631135564]:7.040851727747465)[&rate=0.010986570567484494]:2.257049446900292,(18[&rate=0.009123432243563103]:2.461289418776003,19[&rate=0.00981822432115329]:2.461289418776003)"

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Jan 28 08:42:07 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 27 Jan 2007 - 22:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.