in reply to print data between with regexp...again
The code
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { print /\b\s\d+\.\d+\b|\b\d+\.\d+\b(.*?)\bcache\b/; print "\n"; print /\b\s|\d+\.\d+\b(.*?)\bcache\b/; print "\n"; } __DATA__ 42.95 7712 15:20:05 08:30 23684 cache -s/usr/cachesys/mgr -cj -p +374 JOB^CCJOB 42.18 7712 03:31:27 11:57:08 27747 cache -s/usr/cachesys/mgr -cj -p +91 JOB^CCJOB
outputs
7712 15:20:05 08:30 23684 7712 15:20:05 08:30 23684 7712 03:31:27 11:57:08 27747 7712 03:31:27 11:57:08 27747
where I have not modified your regular expressions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print data between with regexp...again
by Anonymous Monk on Nov 02, 2010 at 19:52 UTC | |
by kennethk (Abbot) on Nov 02, 2010 at 20:09 UTC | |
by Anonymous Monk on Nov 02, 2010 at 20:34 UTC |