We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the
matching substring must either be at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end of the line or followed by a
non-word constituent character. Word-constituent characters are letters, digits, and the
underscore. This option has no effect if -x is also specified.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
'Grep' #1
You are viewing a single comment's thread. Return to all comments →
grep -w "the"
-w, --word-regexp Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore. This option has no effect if -x is also specified.