Skip to content

Word boundaries and gregexpr in R 2.2.1

1 message · 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 with some character not in the text.
On 1/31/06, Stefan Th. Gries <stgries_lists at arcor.de> wrote: