Re: [R] why the "[^\\d]" is not equal to "[^0-9]" in R regular expression?

2013-12-29 Thread William Dunlap
ibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of luofeiyu > Sent: Sunday, December 29, 2013 3:42 AM > To: R-help@r-project.org > Subject: [R] why the "[^\\d]" is not equal to "[^

[R] why the "[^\\d]" is not equal to "[^0-9]" in R regular expression?

2013-12-29 Thread luofeiyu
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 `[