alphanumeric regular expression in R

前端 未结 2 886
庸人自扰
庸人自扰 2021-01-23 19:46

I am trying to use [:alnum:] as explained on ?regex

Anyone knows why

grepl(\"^([a-zA-Z0-9])+([;])\", x=\"dj5sads;adsa\")

returns TRU

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-23 20:15

    what you want is

    grepl("^([[:alnum:]])+([;])", x="dj5sads;adsa")    
    

    remember we put the SearchPattern

提交回复
热议问题