Help using grep

isolder

Registered
I'm trying to figure out how to use grep to search a single file or multiple files for any string that is strictly 4 characters long.

The file would either be a list, containing one word per line, or it would be out of a paragraph.

How can I tell grep to extract all 4 digit words or numbers?
 
The manual for BBEdit has all the GREP rules.

\b is a border between a word and a non-word.

\w is any word character (a-z, A-Z, 0-9, _, and some 8-bit characters)


So I believe you want to use this:

\b\w\w\w\w\b

If that ain't right, then read the PDF manual for BBEdit.
 
man grep
search google for 'howto' 'grep' 'patterns'
but basically my answer just says 'huh? dunno either'. ;)
 
Back
Top