[R] : regular expressions: escaping a dot

Wolfram Fischer
2007-06-28T07:43:57Z

What's really the problem with:

> regexpr( '\.odt$', "xxxxYodt", perl=TRUE )
	Warning: '\.' is an unrecognized escape in a character string
	Warning: unrecognized escape removed from "\.odt$"
	[1] 5
	attr(,"match.length")
	[1] 4

I know that I could use:
> regexpr( '[.]odt$', "xxxxYodt", perl=TRUE )

But it seems to me that the first expression is also
an accepted regular expression in accordance with perl.

Regards - Wolfram