You're making this more difficult for us because you don't really specify the output you're specifically seeking.

Your code seems to indicate that you're looking for the associated value for the "msgagt" key (which has the value "ESM_WMB_AIX" in the data you provide). Is this correct?

My assumption is that this is what you're looking for. Given that,

my $data = qq(msgagt=ESM_WMB_AIX,sec_id=Sec_id,severity=Low,node=test, +msgnode=qwmbap01.xxxxxxxxxxxxx.net,utc=2007-04-26 18:01:59.472+00:00, +om=UID=3a7affd6-f420-11db-80b1-000000000000,AlertCode=AEM001,AlertTyp +e=AEM-default,AppName=AEM-CommonService2,Message=5004:An error has be +en reported by the BIPXML4C component.:XML); my ($msgagt) = $data =~ /msgagt=([^,]+)/; print $msgagt, "\n";

Am I missing any other specs for this problem?


Where do you want *them* to go today?

In reply to Re: key value pair or simply a regexp by thezip
in thread key value pair or simply a regexp by mikejones

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.