Select only those lines containing matches that form whole words. [...] Word-constituent characters are letters, digits, and the underscore.
The underscore is valid as part of an identifier in most programming languages (at least C, Perl, shell), which is probably why it's considered a "word-character" here.
One way to match just word would be to use the negative look-ahead and look-behind tests that Perl regexes provide. Here
(?<![a-z]) means "not preceded by a lower case character, and
(?![a-z]) similarly for what comes after. The beginning and end of the line aren't lower case characters, so this will match
proc even at the beginning:
pcregrep '(?<![a-z])proc(?![a-z])' filename
Or with a grep ERE, taking the beginning and end of a line explicitly into account:
grep -E '(^|[^a-z])proc([^a-z]|$)' filename
(I'm not sure which one of those is prettier.)
If you have natural-language text,
[[:alpha:]] might be more correct than
But of course, just grepping for
_proc_ is easier, if you know the underscores will be there.