regex - What is the regular expression that matches the word 'Coal'? -



regex - What is the regular expression that matches the word 'Coal'? -

i'm using grep command in r find occurrences of word coal in column of info frame. coal can occur anywhere in value. example, coal combustion valid value. regular look this?

i've tried using:

grep("[:coal:]", nei[,5])

but not give me right answers.

any help appreciated.

try

grep("\\bcoal\\b", nei[,5])

the \b part matches word boundaries "coal" can't touching other letters.

regex r grep

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -