<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: regular expressions gurus in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255046#M658780</link>
    <description>JRF&lt;BR /&gt;&lt;BR /&gt;can you show me how this would be incorporated into this line? If at all possible.&lt;BR /&gt;&lt;BR /&gt;@nextline=split( ,$nline);</description>
    <pubDate>Fri, 10 Sep 2010 17:53:36 GMT</pubDate>
    <dc:creator>Jim Purtell</dc:creator>
    <dc:date>2010-09-10T17:53:36Z</dc:date>
    <item>
      <title>regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255044#M658778</link>
      <description>I have a string I'm trying to chop up to ruturn just a portion to the screen when called/printed. &lt;BR /&gt;&lt;BR /&gt;This is the entire string.&lt;BR /&gt; &lt;OBJECT&gt;&lt;PARAM name="loggerName" value="test" /&gt;&lt;BR /&gt;&lt;BR /&gt;This is what I'm trying to return.&lt;BR /&gt;test&lt;BR /&gt;&lt;BR /&gt;How can the following code make this happen (note - I'm using the regex in the split section below).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;open (TEXT_FILE, "&amp;lt;$WD/IqServers.xml");&lt;BR /&gt;while ($line = &lt;TEXT_FILE&gt;) {&lt;BR /&gt;     if ($line =~ m/$port/) {&lt;BR /&gt;     $nline = &lt;TEXT_FILE&gt; ;&lt;BR /&gt;     @nextline=split( ,$nline);&lt;BR /&gt;&lt;BR /&gt;#print "$nline\n";&lt;BR /&gt;print "$nextline[0]\n";&lt;BR /&gt;&lt;BR /&gt;close (TEXT_FILE);&lt;BR /&gt;&lt;/TEXT_FILE&gt;&lt;/TEXT_FILE&gt;&lt;/OBJECT&gt;</description>
      <pubDate>Fri, 10 Sep 2010 16:46:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255044#M658778</guid>
      <dc:creator>Jim Purtell</dc:creator>
      <dc:date>2010-09-10T16:46:52Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255045#M658779</link>
      <description>Hi Jim:&lt;BR /&gt;&lt;BR /&gt;If all you want is the string in double quotes following the string "value=" you might do:&lt;BR /&gt;&lt;BR /&gt;# X='&lt;OBJECT&gt;&lt;PARAM name="loggerName" value="test" /&gt;'&lt;BR /&gt;&lt;BR /&gt;# echo $X|perl -nle 'm{value="([^"]+)"} and print $1'&lt;BR /&gt;test&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/OBJECT&gt;</description>
      <pubDate>Fri, 10 Sep 2010 17:10:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255045#M658779</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-10T17:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255046#M658780</link>
      <description>JRF&lt;BR /&gt;&lt;BR /&gt;can you show me how this would be incorporated into this line? If at all possible.&lt;BR /&gt;&lt;BR /&gt;@nextline=split( ,$nline);</description>
      <pubDate>Fri, 10 Sep 2010 17:53:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255046#M658780</guid>
      <dc:creator>Jim Purtell</dc:creator>
      <dc:date>2010-09-10T17:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255047#M658781</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;So it seems that $nline holds what you want to match and extract from.  Hence:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;$nline = &lt;TEXT_FILE&gt;;&lt;BR /&gt;$nline =~ m{value="([^"]+)"} and print $1,"\n";&lt;BR /&gt;&lt;BR /&gt;...will print the word "test" in your example.&lt;BR /&gt;&lt;BR /&gt;We want to match the contents of $nline.  We are looking for the string 'value="..."' and we want to extract whatever lies between an opening double quote and a closing one.  If we can match this, the $1 variable holds the match and that's what we print.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/TEXT_FILE&gt;</description>
      <pubDate>Fri, 10 Sep 2010 18:19:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255047#M658781</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-09-10T18:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255048#M658782</link>
      <description>JRF,&lt;BR /&gt;that's the answer I was looking for .. &lt;BR /&gt;Thank you so much!!&lt;BR /&gt;&lt;BR /&gt;I'm still reading my camel book on the section of Pattern-Matching Operators though.&lt;BR /&gt;&lt;BR /&gt;Regex's are a beast! But I'm still learning :-)&lt;BR /&gt;&lt;BR /&gt;thanks again</description>
      <pubDate>Fri, 10 Sep 2010 18:50:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255048#M658782</guid>
      <dc:creator>Jim Purtell</dc:creator>
      <dc:date>2010-09-10T18:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: regular expressions gurus</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255049#M658783</link>
      <description>Thanks for the quick help JRF!</description>
      <pubDate>Fri, 10 Sep 2010 18:51:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expressions-gurus/m-p/5255049#M658783</guid>
      <dc:creator>Jim Purtell</dc:creator>
      <dc:date>2010-09-10T18:51:32Z</dc:date>
    </item>
  </channel>
</rss>

