Thanks in advance, oh wise Monks... OK, this is ugly, but I need to search it, take this glob of text:

SAOHXXX20090209XXX020607XXXchazerpap07_PRD_00XXX1XXXN0013IT_QALS-LWEDTL000216V00 0820090207X000800000000X000800000000X000833333333X000820090207N0004JESTL000268V0 034 000X00340000000000000000000000000000000000X003 400000000000XXX00000000000000000000000X00342222222222222222222222222222222333X00 340000000000000000000000000000000000N0014<%_TABLE_MAKT>L0003204V0003???X0006???? ??X0006??????N0009IT_LIST[]L00018V0019Table IT_1042x76XXX0TH034\PROGRAM=ZKQMR_ INSP\DATA=IT_LIST[]TH100Table reference: 56 TH055TABH+ 0(20) = FFFFFFFCC883EE98 FFFFFFFCC895FBB800XXX000000TH055TABH+ 20(20) = 000000380000006800000002000002F8F FFFFFFFTH047TABH+ 40(16) = 0400000000004040001024C401800000TH033store = 0 xFFFFFFFCC883EE98TH033ext1 = 0xFFFFFFFCC895FBB8TH033sXXXhmId = 0 (0x00000000)TH033id = 56 (0x00000038)TH033label = 104 (0x00000068)TH033fill = 2 (0x00000002)TH033leng = 760 (0x0 00002F8)TH033loopXXX = -1 (0xFFFFFFFF)TH026xtyp = TYPE#000328TH033oc cu = 16 (0x00000010)TH039access = 1 (ItAccessStandard)TH034 idxKind = 0 (ItIndexNone)TH034uniKind = 2XXX(ItUniqueNon)TH030keyK ind = 1 (default)TH032cmpMode = 8 (cmpManyEq)TH016occu0 = 1TH016groupCntl = 0TH016rfc = 0TH016unShareable = 0TH017mightBeS hared = 0TH020sharXXXedWithShmTab = 0TH016isShmLockId = 0TH016gcKind = 0T H016isUsed = 1TH016isCtfyAble = 1TH039>>>>> Shareable Table Header Data <<<<<TH033tabi = 0xFFFFFFFCC881FDE8%M

OK, in the middle of that mess there exists the string "PROGRAM=". I am regexing like this: $_ =~ /PROGRAM=(.*)\\/; in order to capture what comes after the = sign. This works most of the time, but for some of these blobs, like this one, I get "02" for an answer instead of "ZKQMR_ INSP", which I was hoping to get. Where is the "02" coming from? It's driving me crazy!

In reply to Very Strange Result from REGEX by rementis

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.