[oclug] My first dum question of the day
masud at googgun.com
Thu Apr 5 12:04:26 EDT 2001
-----BEGIN PGP SIGNED MESSAGE-----
Well if you are looking for the _WORD_ BOB
Mr. BOB was a good man
BOBBING was his hobby
IF the only line you were interested in was the first and wanted to
ignore the second one then:
grep -e '^BOB$' -e '^BOB[ \t]' -e '[ \t][ \t]*BOB[ \t]' -e '[
Also, you may want to replace [ \t] with a more language specific
(english in this case)
e.g. the above would not match
Once upon a time, there lived a guy named BOB. He was a happy guy.
grep -e '^BOB$' -e '^BOB[ \.,!;\?\t]' -e '[ \t][ \t]*BOB[
\.,!;\?\t]' -e '[ \t]BOB$'
would match BOB in above, and in most punctuated sentences. But you
get the idea.
> -----Original Message-----
> From: oclug-admin at lists.oclug.on.ca
> [mailto:oclug-admin at lists.oclug.on.ca]On Behalf Of Computer Books
> For Less
> Sent: Thursday, April 05, 2001 10:09 AM
> To: oclug at lists.oclug.on.ca
> Subject: [oclug] My first dum question of the day
> How would I do a search like this...
> Search a line and find the word BOB, but only if it is in caps?
> The search must be done using posix based regular expressions.
> Bruce Harding
> Manager: Computer Books For Less
> Manager of Procurements: Computer Supply House
> 105 O'Connor Street
> Ottawa ON K1P 5M8
> Phone: 613-233-7418
> Fax: 613-233-6823
> 122 Princess Street
> Kingston ON K7L 1A7
> Phone: 613-531-4550
> Fax: 613-544-8007
> oclug mailing list
> oclug at lists.oclug.on.ca
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
-----END PGP SIGNATURE-----
More information about the OCLUG