<?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 expression result in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051740#M136669</link>
    <description>You are running into RE's "match the most I can" policy. You need to break qualify your requirements more.&lt;BR /&gt;&lt;BR /&gt;This should work better:&lt;BR /&gt;&lt;BR /&gt;echo "TRU 123ZER" | sed 's/[^0-9]*\([0-9][0-9]*\).*/\1/' &lt;BR /&gt;&lt;BR /&gt;HTH.</description>
    <pubDate>Tue, 19 Aug 2003 12:46:45 GMT</pubDate>
    <dc:creator>Brian Bergstrand</dc:creator>
    <dc:date>2003-08-19T12:46:45Z</dc:date>
    <item>
      <title>Regular expression result</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051738#M136667</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I write :&lt;BR /&gt;echo "TRU 123ZER" | sed 's/.*\([0-9][0-9]*\).*/\1/'&lt;BR /&gt;and the result is "3".&lt;BR /&gt;&lt;BR /&gt;Shouldn't it be "123" ?*&lt;BR /&gt;&lt;BR /&gt;Thanx.</description>
      <pubDate>Tue, 19 Aug 2003 12:16:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051738#M136667</guid>
      <dc:creator>Sébastien N</dc:creator>
      <dc:date>2003-08-19T12:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression result</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051739#M136668</link>
      <description>Sebastian,&lt;BR /&gt;  I think there should a space between first .*&lt;BR /&gt;&lt;BR /&gt;echo "TRU 123ZER" | sed 's/.* \([0-9][0-9]*\).*/\1/' &lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Umapathy&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Aug 2003 12:33:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051739#M136668</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-08-19T12:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression result</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051740#M136669</link>
      <description>You are running into RE's "match the most I can" policy. You need to break qualify your requirements more.&lt;BR /&gt;&lt;BR /&gt;This should work better:&lt;BR /&gt;&lt;BR /&gt;echo "TRU 123ZER" | sed 's/[^0-9]*\([0-9][0-9]*\).*/\1/' &lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Tue, 19 Aug 2003 12:46:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051740#M136669</guid>
      <dc:creator>Brian Bergstrand</dc:creator>
      <dc:date>2003-08-19T12:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression result</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051741#M136670</link>
      <description>Both are working.&lt;BR /&gt;But I don't understand why...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanx a lot.&lt;BR /&gt;&lt;BR /&gt;what does HTH mean ?</description>
      <pubDate>Tue, 19 Aug 2003 12:58:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051741#M136670</guid>
      <dc:creator>Sébastien N</dc:creator>
      <dc:date>2003-08-19T12:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression result</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051742#M136671</link>
      <description>Sebastian,&lt;BR /&gt;  As Brian said, "match the most I can" is done by .* which expands to a char followed by any number of chars that include a space also. &lt;BR /&gt;  The backslashed number represents the group of chars within the braces.  Here in your exp you match only the numbers with your braces and thats get printed. &lt;BR /&gt;  Without spaces all the numbers except 3 is gathered by the first .*.  &lt;BR /&gt;  &lt;BR /&gt;  HTH means Hope This Helps.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Umapathy&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Aug 2003 13:23:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/regular-expression-result/m-p/3051742#M136671</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-08-19T13:23:50Z</dc:date>
    </item>
  </channel>
</rss>

