[R] Match beginning and end of string (grepl)

2014-09-02 Thread Johannes Radinger
Hi, I'd like to match the beginning and the end of a string. E.g. I want to extract all strings from a vector that beginn with 12 and end with Apples: a - 2 green Apples b - 12 green Apples c - 12 Apples and 2 green Bananas d - 12 yellow Bananas fruitlist - c(a,b,c,d) # This is how to extract

Re: [R] Match beginning and end of string (grepl)

2014-09-02 Thread John McKown
On Tue, Sep 2, 2014 at 7:12 AM, Johannes Radinger johannesradin...@gmail.com wrote: Hi, I'd like to match the beginning and the end of a string. E.g. I want to extract all strings from a vector that beginn with 12 and end with Apples: a - 2 green Apples b - 12 green Apples c - 12 Apples