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";
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|