Ok I have read previous deiscussions on this and they did help :D However I have another type data to parse through. I am running through a Cisco router config and have managed to pull out the relevant section of the config I require, however the END point in the range operator expression I wish to leave out when returning the required part of the config.

Here is the extracted data:

policy-map CE-PE-ADCORP-EA-LM-RBA-INPUT
class ADCORP-EA-LM-INPUT-OUTPUT-PLATINUM
police cir 640000 bc 240000 be 480000
conform-action set-mpls-exp-transmit 4
exceed-action set-mpls-exp-transmit 3
violate-action drop
class ADCORP-EA-LM-RBA-INPUT-OUTPUT-GOLD
police cir 256000 bc 96000 be 192000
conform-action set-mpls-exp-transmit 2
exceed-action set-mpls-exp-transmit 1
violate-action drop
policy-map CE-PE-UBSW-PRIMARY-INPUT

This is the code I'm using in the match after reading in the router config file is:

$ouputpol = "CE-PE-ADCORP-EA-LM-RBA-INPUT"; if (/^ policy-map $ouputpol/.../ policy-map/) { print; }
Now I'm grabbing everything between and including the line starting with my policy-map I'm interested in until the next policy-map. Now I want to exclude the line "policy-map CE-PE-UBSW-PRIMARY-INPUT" in the output of my expression.

How do I go about this....I'm stumped......?? I'm sure it's simple but I'm just not seeing it.
Another question I have is how do I print all text between two html tags using the .. operator but exclude the tags themselves after reading in an html file?
Example:
plenty html up here <pre> a whole bunch of text here </pre> a whole lot more html here
If this is confusing let me know?

In reply to Matching between START and END revisited by PenguinFeva

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.