Re: [R] gsub wildcard

2011-08-15 Thread Rebecca Gray
Hi Peter, Well the problem is that I need to also move the ":" to the front of the bracketed expression, although I like the simplicity of your statement. I cannot replace all of the "[" with ":[" because I am actually just using a small example from a large file, and there are many more "[" that

Re: [R] gsub wildcard

2011-08-15 Thread Peter Langfelder
On Mon, Aug 15, 2011 at 10:34 AM, Rebecca Gray wrote: > Hello all, > > I have what I think is a simple question but I've been unable to solve it. I > have the following string: > > A[&states=1]:[&rate=2]425, B[&states=3]:[&rate=5]500 > > I would like to combine the two expressions in the [], so th

[R] gsub wildcard

2011-08-15 Thread Rebecca Gray
Hello all, I have what I think is a simple question but I've been unable to solve it. I have the following string: A[&states=1]:[&rate=2]425, B[&states=3]:[&rate=5]500 I would like to combine the two expressions in the [], so that only one set of [] is present after each letter, so that I have t