Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Problem with regex ...

by LanX (Chancellor)
on Dec 26, 2012 at 22:26 UTC ( #1010424=note: print w/ replies, xml ) Need Help??

in reply to Problem with regex ...

If your problem is to distinguish between different blocks, then test for the delimiting "white line".

my $block=0; while (<DATA>){ if (!/^\s*$/) { print "$block: $_"; } else { $block++; } } __DATA__ Mod Ports Card Type Model Se +rial No. --- ----- -------------------------------------- ------------------ -- +--------- 1 24 CEF720 24 port 1000mb SFP WS-X6724-SFP SA +L1434RA09 3 20 7600 ES+T 76-ES+T-20G JA +E14530455 4 ... Mod Sub-Module Model Serial Hw + Status ---- --------------------------- ------------------ ----------- ------ +- ------- 1 Distributed Forwarding Card WS-F6700-DFC3CXL SAL1434RLPY 1.6 + Ok 3 7600 ES+ DFC XL 7600-ES+3CXL JAE14520N29 1.2 + Ok 5 ...

now you can delegate the rest to specific one-block solution(s).

Cheers Rolf

Comment on Re: Problem with regex ...
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010424]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2016-02-13 19:54 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (443 votes), past polls