[R] Word boundaries and gregexpr in R 2.2.1

2006-01-31 Thread Stefan Th. Gries
Hi I have a question concerning how to match word boundaries which I bet has a very simple answer, but I haven't found it with trial and error nor by searching the help archives for the terms in the subject line. The problem is this: I have a vector of two character strings. text-c(This is a

Re: [R] Word boundaries and gregexpr in R 2.2.1

2006-01-31 Thread Gabor Grothendieck
When I tried it on Windows XP there was a grinding sound, probably memory being swapped and it just seemed to go on forever and I finally had to kill R. I am using R version 2.2.1, 2005-12-20. What did seem to work was this: gregexpr(X, gsub(\\b\\w|\\w\\b, X, text)) where X should be replaced