Skip to content
Prev 277452 / 398506 Next

Regular expressions in R

Hi Michael,

You need to take another look at the examples you were given, and at
the help for ?sub():

     The two ?*sub? functions differ only in that ?sub? replaces only
     the first occurrence of a ?pattern? whereas ?gsub? replaces all
     occurrences.  If ?replacement? contains backreferences which are
     not defined in ?pattern? the result is undefined (but most often
     the backreference is taken to be ?""?).

Sarah

On Tue, Nov 15, 2011 at 12:18 PM, Michael Griffiths
<griffiths at upstreamsystems.com> wrote: