I think you want "[[:digit:]]" instead of "[:digit:]"

--Ista

On Mon, Jul 2, 2018 at 8:52 AM, Martin Møller Skarbiniks Pedersen
<traxpla...@gmail.com> 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 output.
>    I expected integer(0) also for this case.
>
> case 1:
> grep("[:digit:]", "**ABAAbabaabackabaloneaban")
> integer(0)
>
> case 2:
> grep("[:digit:]", "**ABAAbabaabackabaloneaband")
> [1] 1
>
> Regards
> Martin
>
> ______________________________________________
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to