<?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 help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084460#M92836</link>
    <description>&amp;gt;I don't want the _pkg portion of the string either though.&lt;BR /&gt;&lt;BR /&gt;Ah, that makes it easier.&lt;BR /&gt;$ sed 's/.*id="\(.*\)_pkg".*/\1/' testfile</description>
    <pubDate>Mon, 17 Dec 2007 01:39:59 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-12-17T01:39:59Z</dc:date>
    <item>
      <title>Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084455#M92831</link>
      <description>Ok, this is my weakest part of scripting things and there's probably some short regexp I could use with sed to accomplish what I need so I'll pick people's brains on here. :)&lt;BR /&gt;&lt;BR /&gt;I have an XML configuration file that has a line with the following format:&lt;BR /&gt;&lt;BR /&gt;&lt;GROUP id="cluster_pkg" ordered="true"&gt;&lt;BR /&gt;&lt;BR /&gt;I'm trying to grab the "cluster" portion of the string. However, the id and ordered parameters can be reversed randomly so it's not as simple as I'd assumed at first.&lt;/GROUP&gt;</description>
      <pubDate>Mon, 17 Dec 2007 00:48:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084455#M92831</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2007-12-17T00:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084456#M92832</link>
      <description>What do you want to grab?  "cluster_pkg"?&lt;BR /&gt;You could just ignore the "ordered" part:&lt;BR /&gt;&lt;BR /&gt;$ sed -e 's/group id="\(.*\)" /\1/' file&lt;BR /&gt;&lt;BR /&gt;This should work as long as "true" doesn't have a space after it.</description>
      <pubDate>Mon, 17 Dec 2007 01:10:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084456#M92832</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-12-17T01:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084457#M92833</link>
      <description>&lt;!--!*#--&gt;Oops that doesn't handle the reverse.  I assume you are only getting lines with the two?&lt;BR /&gt;$ sed -e 's/&lt;GROUP id="\(.*\)"&gt;&lt;/GROUP&gt;      -e 's/ group id="\(.*\)"&amp;gt;/\1/' file&lt;BR /&gt;</description>
      <pubDate>Mon, 17 Dec 2007 01:16:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084457#M92833</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-12-17T01:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084458#M92834</link>
      <description>Close, but not quite there... I modified it a little to get really close to what I need.&lt;BR /&gt;&lt;BR /&gt;testfile contains:&lt;BR /&gt;&lt;BR /&gt;       &lt;GROUP ordered="true" id="back_pkg"&gt;&lt;BR /&gt;       &lt;GROUP id="back_pkg" ordered="true"&gt;&lt;BR /&gt;&lt;BR /&gt;With this command:&lt;BR /&gt;&lt;BR /&gt;sed 's/.*id="\(.*_pkg\)".*/\1/' testfile&lt;BR /&gt;&lt;BR /&gt;It returns:&lt;BR /&gt;&lt;BR /&gt;cluster_pkg&lt;BR /&gt;cluster_pkg&lt;BR /&gt;&lt;BR /&gt;I don't want the _pkg portion of the string either though.&lt;/GROUP&gt;&lt;/GROUP&gt;</description>
      <pubDate>Mon, 17 Dec 2007 01:35:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084458#M92834</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2007-12-17T01:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084459#M92835</link>
      <description>Got it! Moved the \) to before the _pkg in the sed command. Yippe! :)&lt;BR /&gt;&lt;BR /&gt;Command looks like this:&lt;BR /&gt;&lt;BR /&gt;sed 's/.*id="\(.*\)_pkg".*/\1/' testfile</description>
      <pubDate>Mon, 17 Dec 2007 01:38:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084459#M92835</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2007-12-17T01:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regular expression help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084460#M92836</link>
      <description>&amp;gt;I don't want the _pkg portion of the string either though.&lt;BR /&gt;&lt;BR /&gt;Ah, that makes it easier.&lt;BR /&gt;$ sed 's/.*id="\(.*\)_pkg".*/\1/' testfile</description>
      <pubDate>Mon, 17 Dec 2007 01:39:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regular-expression-help/m-p/5084460#M92836</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-12-17T01:39:59Z</dc:date>
    </item>
  </channel>
</rss>

