[R] gsub

Sarah Goslee sarah.goslee at gmail.com
Thu Jun 14 15:22:08 CEST 2012


> sub("I\\((.*?)\\)", "\\1", t1) # nongreedy
[1] "(Ithis) test"


On Thu, Jun 14, 2012 at 7:03 AM, nalluri pratap <pratap_stat at yahoo.co.in> wrote:
>
> Hi,
>
> I have a string t1="(Ithis) I(test)". I need to get t2="(Ithis) test".
>
> Can someone look into this. ?I have tried using gsub("I[^)]","",t1) , but didn't get the required result.
>
> Thanks,
> Pratap
>        [[alternative HTML version deleted]]
>
>



-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list