First of all, when asking a question and then later on changing it, it would be nice if you mentioned the question has been updated or modified. That way people that replied to the original question won't look as though they're talking out of their *insert favorite bodypart here*.

As for the actual regex, you asked for all the data, so by that I assume you don't want to get rid of any html tags. I'll also assume you mean TRNsquare_thingy instead of the other way around...

use strict; use warnings; my $blurb = 'Starting the , text and there are more TESTBPR<b>PE12. +3AZ234anything, BPR set ? & @ TRN $ ?of charactersCan be anythin +g BPR* TRN# in here79something here11<b>TRN1 1415161718P +E12.3AZST21st371718PE12.3AZST21stand so on and more text fol +lows'; #035 is the octal for that squarethingy you got there... $blurb =~ /\035BPR(.+)TRN\035/; print "result: $1\n";

Remember rule one...


In reply to Re: Regular expression help Needed by Forsaken
in thread Regular expression help Needed by rockets12345

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.