gregexpr(pattern="[^0-9]","+12345ty")
[[1]]
[1] 1 7 8
attr(,"match.length")
[1] 1 1 1
attr(,"useBytes")
[1] TRUE
gregexpr(pattern="[^\\d]","+12345ty")
[[1]]
[1] 1 2 3 4 5 6 7 8
attr(,"match.length")
[1] 1 1 1 1 1 1 1 1
attr(,"useBytes")
[1] TRUE

why the pattern `[^\\d]` has no same effect as of `[^0-9]` ?

______________________________________________
R-help@r-project.org 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.

Reply via email to