regex - alphanumeric regular expression in R -


i trying use [:alnum:] explained on ?regex

anyone knows why

grepl("^([a-za-z0-9])+([;])", x="dj5sads;adsa") 

returns true,

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

returns false?

[:alnum:] name of class. want put named class character class, have enclose pair of []:

[[:alnum:]] 

in example it'd be

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

demo @ ideone


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -