Skip to content

gsub wildcard

3 messages · Rebecca Gray, Peter Langfelder

#
On Mon, Aug 15, 2011 at 10:34 AM, Rebecca Gray <atlasrrg at gmail.com> wrote:
How about a simpler solution:

x = "A[&states=1]:[&rate=2]425, B[&states=3]:[&rate=5]500"

gsub("]:[", ", ", x, fixed = TRUE)

i.e., simply replace ]:[ by ,

will that work?

Peter