in reply to nested reg ex over multiple lines
This outputs:use strict; use warnings; my $content = ""; while (<DATA>) { $content = $content . $_; } print "content: $content"; # sanity check while ($content =~m/^(CAL.+\((\w+)\))/mg){ print "\n1= $1"; print "\n2= $2"; } __DATA__ CALCON(test1) { TYPE(U8) FEATURE(DCOM) NAM(stmin) LABEL(Min seperation time between CFs) MIN(0) MAX(127) UNITS(ms) } CALCON(test2) { TYPE(U16) FEATURE(DCOM) NAM(dcomc_sestmr_timeout) LABEL(DCOM Session Timer Timeout) MIN(0) MAX(65535) UNITS(ms) }
1= CALCON(test1) 2= test1 1= CALCON(test2) 2= test2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: nested reg ex over multiple lines
by eg8rds (Acolyte) on Jun 20, 2005 at 13:30 UTC | |
by holli (Abbot) on Jun 20, 2005 at 13:49 UTC | |
by tphyahoo (Vicar) on Jun 20, 2005 at 14:18 UTC |