Skip to content
Prev 180279 / 398513 Next

matching period with perl regular expression

R interprets backslash to give special meaning to the next character, i.e.
it strips off the backslash and send the following character to gsub
possibly reinterpreting it specially (for example \n is newline).  Thus
a backslash will never get to gsub unless you use a double backslash.
Thus we can use "'\\." to represent \.   Also note that
that the regular expression "[.]" represents a literal dot and does not
require a backslash in the first place.  You don't need perl  = TRUE for
simple regular expressions like this.
On Wed, May 13, 2009 at 7:41 PM, Stephen J. Barr <stephenjbarr at gmail.com> wrote: