Re: [R] Pattern Matching Replacement

2008-06-19 Thread Hans-Jörg Bibiko
On 19.06.2008, at 20:17, ppatel3026 wrote: I would like to replace "\r\n" with "" in a character string, where "\r\n" exists only between < and >, how could I do that? Initial: characterString = "\r\n" Result: characterString = "\r\nXML>" Tried with sub(below) but it only replaces the f

Re: [R] Pattern Matching Replacement

2008-06-19 Thread Gabor Grothendieck
On Thu, Jun 19, 2008 at 2:17 PM, ppatel3026 <[EMAIL PROTECTED]> wrote: > > I would like to replace "\r\n" with "" in a character string, where "\r\n" > exists only between < and >, how could I do that? > > Initial: > characterString = " id=\"F\r\n2\">\r\n" > > Result: > characterString = "\r\n" > >

[R] Pattern Matching Replacement

2008-06-19 Thread ppatel3026
I would like to replace "\r\n" with "" in a character string, where "\r\n" exists only between < and >, how could I do that? Initial: characterString = "\r\n" Result: characterString = "\r\n" Tried with sub(below) but it only replaces the first instance and I am not sure how to pattern match s