Re: [R] Regular Expressions

From: John Bullock <>
Date: Tue 13 Jul 2004 - 12:47:15 EST

If you use the RPerl interface
(, you can do this simply for any number of expressions by letting Perl do the matching. If "strings" is the array of strings that you want to test, all you need is

    for (@strings) {

        if (/thomas/ && /perl/ && /prog/) {do something}

But I don't know a simple way to do it in R.


> Hi,
> Is there a way to use regular expressions to capture
two or more words in a
> sentence? For example, I wish to to find all the lines
that have the words "thomas",
> "perl", and "program", such as "thomas uses a program
called perl", or "perl is a
> program that thomas uses", etc.
> I'm sure this is a very easy task, I would greatly
appreciate any help. Thanks!
> Sangick
> ______________________________________________
> mailing list
> PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Tue Jul 13 12:56:44 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:54 EST