Re: [R] Regexp bug or misunderstanding

2018-07-02 Thread Dénes Tóth
Hi Martin, I assume you want to check whether a particular character string contains a digit. In this case you should use the following pattern: "[[:digit:]]" instead of "[:digit:]". From ?regex: "A character class is a list of characters enclosed between [ and ] which matches any single cha

Re: [R] Regexp bug or misunderstanding

2018-07-02 Thread Ista Zahn
I think you want "[[:digit:]]" instead of "[:digit:]" --Ista On Mon, Jul 2, 2018 at 8:52 AM, Martin Møller Skarbiniks Pedersen wrote: > Hi, > >Have I found a bug in R? Or misunderstood something about grep() ? > >Case 1 gives the expected output >Case 2 does not gives the expected ou