Thread View: news.software.nn
6 messages
6 total messages
Started by Nancy McGough
Tue, 13 Sep 1994 06:06
Re: nngrab - Specific Searches
Author: Nancy McGough
Date: Tue, 13 Sep 1994 06:06
Date: Tue, 13 Sep 1994 06:06
35 lines
1973 bytes
1973 bytes
dmws@uhura.cc.rochester.edu (D. Williams) writes: >I use nngrab a lot and am wondering how to do a specific search. For example >if I wanted to find 'com' but not find computer, comfort, etc... > >In other words, I am looking for a way to only find the word I am searching >for and not other words that it is contained within. Thank you. Try this: nngrab "^com[^a-zA-Z]|[^a-zA-Z]com[^a-zA-Z]|[^a-zA-Z]com$" ^com[^a-zA-Z] means starts with ``com'' followed by non-alpha | or [^a-zA-Z]com[^a-zA-Z] non-alpha ``com'' non-alpha | or [^a-zA-Z]com$" ends with ``com'' preceded by non-alpha Instead of nngrab I usually use nn with the appropriate flags, i.e.: nn -mxXs/"^com[^a-zA-Z]|[^a-zA-Z]com[^a-zA-Z]|[^a-zA-Z]com$" Because that way I can customize the flags, e.g., use n instead of s if I'm searching the Name field. Hope this helps, Nancy -- ** ** Nancy McGough | "No one suspects the * ** * Infinite Ink | days to be gods." ** ** ftp://ftp.ii.com/pub/ii | -Emerson
Re: nngrab - Specific Searches
Author: Wayne Berke
Date: Wed, 14 Sep 1994 14:13
Date: Wed, 14 Sep 1994 14:13
46 lines
2219 bytes
2219 bytes
Nancy McGough <nancym@ii.com> writes: >dmws@uhura.cc.rochester.edu (D. Williams) writes: >>I use nngrab a lot and am wondering how to do a specific search. For example >>if I wanted to find 'com' but not find computer, comfort, etc... >> >>In other words, I am looking for a way to only find the word I am searching >>for and not other words that it is contained within. Thank you. >Try this: >nngrab "^com[^a-zA-Z]|[^a-zA-Z]com[^a-zA-Z]|[^a-zA-Z]com$" >^com[^a-zA-Z] means starts with ``com'' followed by non-alpha >| or >[^a-zA-Z]com[^a-zA-Z] non-alpha ``com'' non-alpha >| or >[^a-zA-Z]com$" ends with ``com'' preceded by non-alpha Note that this will also match subjects that contain "com1" or "3com". A cleaner way of doing it is by using the \< and \> metacharacters. They specify word brackets: nngrab "\<com\>" >Instead of nngrab I usually use nn with the appropriate flags, i.e.: >nn -mxXs/"^com[^a-zA-Z]|[^a-zA-Z]com[^a-zA-Z]|[^a-zA-Z]com$" >Because that way I can customize the flags, e.g., use n instead of s >if I'm searching the Name field. >Hope this helps, >Nancy >-- > ** ** Nancy McGough | "No one suspects the >* ** * Infinite Ink | days to be gods." > ** ** ftp://ftp.ii.com/pub/ii | -Emerson -- Wayne Berke berke@panix.com
Re: nngrab - Specific Searches
Author: Nancy McGough
Date: Thu, 15 Sep 1994 03:55
Date: Thu, 15 Sep 1994 03:55
25 lines
1553 bytes
1553 bytes
>Nancy McGough <nancym@ii.com> writes: >>nngrab "^com[^a-zA-Z]|[^a-zA-Z]com[^a-zA-Z]|[^a-zA-Z]com$" berke@panix.com (Wayne Berke) writes: >Note that this will also match subjects that contain "com1" or "3com". > >A cleaner way of doing it is by using the \< and \> metacharacters. They >specify word brackets: > >nngrab "\<com\>" This doesn't work on my system - does it work on other systems? Is this type of regular expression supported by egrep - egrep reg exps is what nn supports.... Thanks, Nancy -- ** ** Nancy McGough | "No one suspects the * ** * Infinite Ink | days to be gods." ** ** ftp://ftp.ii.com/pub/ii | -Emerson
Re: nngrab - Specific Searches
Author: Wayne Berke
Date: Thu, 15 Sep 1994 13:51
Date: Thu, 15 Sep 1994 13:51
29 lines
1749 bytes
1749 bytes
Nancy McGough <nancym@ii.com> writes: >berke@panix.com (Wayne Berke) writes: >>Note that this will also match subjects that contain "com1" or "3com". >> >>A cleaner way of doing it is by using the \< and \> metacharacters. They >>specify word brackets: >> >>nngrab "\<com\>" >This doesn't work on my system - does it work on other systems? >Is this type of regular expression supported by egrep - egrep >reg exps is what nn supports.... You're right. I misread the man page. The word bracketing metacharacters only work for grep, not egrep (although why egrep should have less functionality than grep is a mystery to me). >Thanks, >Nancy >-- > ** ** Nancy McGough | "No one suspects the >* ** * Infinite Ink | days to be gods." > ** ** ftp://ftp.ii.com/pub/ii | -Emerson -- Wayne Berke berke@panix.com
Re: nngrab - Specific Searches
Author: Bob MacDowell
Date: Thu, 22 Sep 1994 23:22
Date: Thu, 22 Sep 1994 23:22
16 lines
1315 bytes
1315 bytes
Nancy McGough <nancym@ii.com> writes: >berke@panix.com (Wayne Berke) writes: >>A cleaner way of doing it is by using the \< and \> metacharacters. They >>specify word brackets: >> >>nngrab "\<com\>" >This doesn't work on my system - does it work on other systems? >Is this type of regular expression supported by egrep - egrep >reg exps is what nn supports.... A quick peek at the Nutshell book shows that as only working in vi, ex and ed. NOT sed, awk, grep and egrep. -Bob
Re: nngrab - Specific Searches
Author: Wayne Berke
Date: Fri, 23 Sep 1994 22:21
Date: Fri, 23 Sep 1994 22:21
25 lines
1611 bytes
1611 bytes
bobmacd@netcom.com (Bob MacDowell) writes: >Nancy McGough <nancym@ii.com> writes: >>berke@panix.com (Wayne Berke) writes: >>>A cleaner way of doing it is by using the \< and \> metacharacters. They >>>specify word brackets: >>> >>>nngrab "\<com\>" >>This doesn't work on my system - does it work on other systems? >>Is this type of regular expression supported by egrep - egrep >>reg exps is what nn supports.... >A quick peek at the Nutshell book shows that as only working in >vi, ex and ed. NOT sed, awk, grep and egrep. Actually, on my system (SunOS 4.1.3) it does work for grep, just not for egrep. >-Bob -- Wayne Berke berke@panix.com
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads