If you use the RPerl interface
(http://www.omegahat.org/RSPerl/), 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.

--John

----- Original Message ----- 
From: "Sangick Jeon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 12, 2004 4:59 PM
Subject: [R] Regular Expressions


>
>
> 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
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to