[R] Cannot use an escape character in regexp

From: Vittorio <vdemart1_at_tin.it>
Date: Fri, 11 May 2007 12:07:33 +0100 (GMT+01:00)

Given the string

> mystr <- "(Preconsuntivo del giorno gas 10 maggio

I'm trying to detect and eliminate the string ")Tj" at the very end of mystr by means of
gsub(rx2,"",mystr) BUT preparing the
matching regexp string a warning pops up

> rx2 <- "\)Tj$"

1: '\)' is an unrecognized escape in a character string 2:
unrecognized escape removed from "\)Tj$"


> rx2

[1] ")Tj$"

tried also rx2 <- "(\))Tj$" but the result is the same.

What am I


R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 11 May 2007 - 11:10:16 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 11 May 2007 - 12:31:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.