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
In reply to Matching for the second,fourth, and fifth word in a text by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |