Thompson, Trevor wrote:
I'm trying to use the regexpr function to locate the decimal in a character
string.  Regardless of the position of the decimal, the function returns 1.
For example,

regexpr(".", "Female.Alabama")

You probably want backslashes to indicate that "." should not be treated as a metacharacter; it should be taken literally.


> regexpr("\\.", "Female.Alabama")
[1] 7
attr(,"match.length")
[1] 1

hope this helps,

Chuck Cleland

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to