kirk123 has asked for the wisdom of the Perl Monks concerning the following question:
I 've been trying to match for certain words in a file without success.
The flat file contains the following text:
I am trying to match on the first word that comes after the word "printer" which is "llp" or "ps". The fourth word after the word "printer" which is idle". The fifth word after "printer" which is "enabled".printer llp is idle. enabled since Wed Oct 23 15:54:08 GMT 2002. avail +able. Form mounted: Content types: any Printer types: unknown Description: OPENprint printer llp Connection: direct Interface: /usr/lib/lp/model/standard On fault: write to root once After fault: continue Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: Default port settings: -opost printer ps is idle. enabled since Wed Oct 23 15:54:17 GMT 2002. availa +ble. Form mounted: Content types: postscript, simple Printer types: unknown Description: local printer Connection: direct Interface: /usr/lib/lp/model/net_lj4x On fault: write to root once After fault: continue Users allowed: (all) Forms allowed: (none) Banner not required Character sets: (none) Default pitch: Default page size: Default port settings:
Basically I am checking if the flat file contain these strings then do something to them.
I 've tried using Backreferences but without success. Could use some help.
--kirk
Added <code> and <p> tags - dvergin 2002-08-29
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Matching for the second,fourth, and fifth word in a text
by BrowserUk (Patriarch) on Dec 10, 2002 at 19:23 UTC | |
Re: Matching for the second,fourth, and fifth word in a text
by particle (Vicar) on Dec 10, 2002 at 19:03 UTC | |
Re: Matching for the second,fourth, and fifth word in a text
by dingus (Friar) on Dec 10, 2002 at 20:17 UTC | |
by Aristotle (Chancellor) on Dec 11, 2002 at 13:53 UTC | |
Re: Matching for the second,fourth, and fifth word in a text
by Aristotle (Chancellor) on Dec 11, 2002 at 14:04 UTC |