Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-25 Thread Greg Snow
: Saturday, July 22, 2006 7:49 PM To: r-help@stat.math.ethz.ch Subject: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences Dear all I use R for Windows 2.3.1 on a fully updated Windows XP Home SP2 machine and I have two related regular expression problems

Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-25 Thread Gabor Grothendieck
] [mailto:[EMAIL PROTECTED] On Behalf Of Stefan Th. Gries Sent: Saturday, July 22, 2006 7:49 PM To: r-help@stat.math.ethz.ch Subject: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences Dear all I use R for Windows 2.3.1 on a fully updated Windows

Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-25 Thread Greg Snow
-Original Message- From: Gabor Grothendieck [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 25, 2006 11:41 AM To: Greg Snow Cc: Stefan Th. Gries; r-help@stat.math.ethz.ch Subject: Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences Regarding having

Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-25 Thread Gabor Grothendieck
Here is yet another solution. This one consists only of two gsubs and a function to reverse a string. It runs at about the same speed as f3 but its main advantage is how compact it is. pat could be the same as before however we have made use of Greg's discussion to use \\w\\w to avail ourself

[R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-22 Thread Stefan Th. Gries
Dear all I use R for Windows 2.3.1 on a fully updated Windows XP Home SP2 machine and I have two related regular expression problems. platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32

Re: [R] RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences

2006-07-22 Thread Gabor Grothendieck
The following requires more than just a single gsub but it does solve the problem. Modify to suit. The first gsub places ... around the first occurrence of any duplicated suffixes. We use the (?=...) zero width regexp to circumvent the nesting problem. Then we use strapply from the gsubfn