<?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: regexp vs. GNU regexp in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776405#M99266</link>
    <description>Dusan,&lt;BR /&gt;&lt;BR /&gt;You can report bugs through "Support Case Manager" under the "Maintenance and support for hp products" link.&lt;BR /&gt;&lt;BR /&gt;Marlou</description>
    <pubDate>Tue, 25 Apr 2006 14:37:30 GMT</pubDate>
    <dc:creator>Marlou Everson</dc:creator>
    <dc:date>2006-04-25T14:37:30Z</dc:date>
    <item>
      <title>regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776400#M99261</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;i'm trying to get one script working with hp-ux's grep (porting from GNU's grep) and i've found different behavior. I'm asking here if someone could explain it:&lt;BR /&gt;&lt;BR /&gt;Text (from comma separated values) which is GNU's grep (in Cygwin) selecting (according to my opinion) correctly and (extened) regular expresion is like this:&lt;BR /&gt;^X:([^,]*,){3}"C&lt;BR /&gt;&lt;BR /&gt;i'm testing it (fourth comma separated value is like "C):&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){3}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;&lt;BR /&gt;ok, match&lt;BR /&gt;&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){4}"C'&lt;BR /&gt;&lt;BR /&gt;ok, it doesn't match&lt;BR /&gt;&lt;BR /&gt;But with hp-ux's grep:&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){3}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;&lt;BR /&gt;match, ok.&lt;BR /&gt;&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){4}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;&lt;BR /&gt;why this match?&lt;BR /&gt;&lt;BR /&gt;echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){5}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;&lt;BR /&gt;also match. Why?&lt;BR /&gt;&lt;BR /&gt;$ uname -a&lt;BR /&gt;HP-UX ccbdevd1 B.11.11 U 9000/800 610389312 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;thanks a lot!&lt;BR /&gt;&lt;BR /&gt;Dusan&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Apr 2006 06:33:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776400#M99261</guid>
      <dc:creator>Dusan Onofer</dc:creator>
      <dc:date>2006-04-24T06:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776401#M99262</link>
      <description>Dusan,&lt;BR /&gt;&lt;BR /&gt;It does appear to be a bug :-(&lt;BR /&gt;&lt;BR /&gt;manually expanded it works:&lt;BR /&gt;&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){5}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)([^,]*,)([^,]*,)([^,]*,)([^,]*,)"C'&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)([^,]*,)([^,]*,)([^,]*,)([^,]*,)"C' &lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)([^,]*,)([^,]*,)([^,]*,)"C'        &lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)([^,]*,)([^,]*,)"C'        &lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)([^,]*,)"C'        &lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,)"C'        &lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){2}"C'&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){3}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){4}"C'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;[root@vpart1 /]# echo 'X: A,,B,"C",,"D"'|grep -E '^X:([^,]*,){6}"C'&lt;BR /&gt;[root@vpart1 /]# &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Even with regexbuilder (&lt;A href="http://sourceforge.net/project/showfiles.php?group_id=76775)" target="_blank"&gt;http://sourceforge.net/project/showfiles.php?group_id=76775)&lt;/A&gt; any variation other than &lt;BR /&gt;^X:([^,]*,){3}"C&lt;BR /&gt;is invalid&lt;BR /&gt;&lt;BR /&gt;Report it as a bug.&lt;BR /&gt;&lt;BR /&gt;I personally would use 'cut -d"," -f4' with grep "\"C\"", but that's not really the reported problem.&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Mon, 24 Apr 2006 08:28:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776401#M99262</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2006-04-24T08:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776402#M99263</link>
      <description>Harry,&lt;BR /&gt;&lt;BR /&gt;thanks for your reply. &lt;BR /&gt;&lt;BR /&gt;It seems to me, it's in libc or where -- sed's behaviour is same.&lt;BR /&gt;&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|sed 's/^X:\([^,]*,\)\{2\}"C/deleted/'&lt;BR /&gt;X: A,,B,"C",,"D"&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|sed 's/^X:\([^,]*,\)\{3\}"C/deleted/'&lt;BR /&gt;deleted",,"D"&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|sed 's/^X:\([^,]*,\)\{4\}"C/deleted/'&lt;BR /&gt;deleted",,"D"&lt;BR /&gt;$ echo 'X: A,,B,"C",,"D"'|sed 's/^X:\([^,]*,\)\{5\}"C/deleted/'&lt;BR /&gt;deleted",,"D"&lt;BR /&gt;&lt;BR /&gt;also attached program reports false match.&lt;BR /&gt;&lt;BR /&gt;btw, where can I report a bug? &lt;BR /&gt;(sorry, I've tryied "googling" over hp.com but didn't find&lt;BR /&gt;any useful links).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Apr 2006 09:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776402#M99263</guid>
      <dc:creator>Dusan Onofer</dc:creator>
      <dc:date>2006-04-24T09:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776403#M99264</link>
      <description>compilable version.&lt;BR /&gt;&lt;BR /&gt;Dusan</description>
      <pubDate>Mon, 24 Apr 2006 09:53:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776403#M99264</guid>
      <dc:creator>Dusan Onofer</dc:creator>
      <dc:date>2006-04-24T09:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776404#M99265</link>
      <description>&lt;BR /&gt;You might find this tool very useful:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.weitz.de/regex-coach/#install" target="_blank"&gt;http://www.weitz.de/regex-coach/#install&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This proves to be the best pattern:&lt;BR /&gt;&lt;BR /&gt;^(X: )([^,]*,)([^,]*,)([^,]*,)(\"C\"\,)([^,]*,)([^,]*)&lt;BR /&gt;&lt;BR /&gt;Using a ([^,]*,){3} instead of manually repeating it causes the pattern to backtrace and grab the same pattern twice. Try your different variations and use the STEP tab (near bottom of window) to walk through the string.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry d brown jr</description>
      <pubDate>Tue, 25 Apr 2006 08:41:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776404#M99265</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2006-04-25T08:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: regexp vs. GNU regexp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776405#M99266</link>
      <description>Dusan,&lt;BR /&gt;&lt;BR /&gt;You can report bugs through "Support Case Manager" under the "Maintenance and support for hp products" link.&lt;BR /&gt;&lt;BR /&gt;Marlou</description>
      <pubDate>Tue, 25 Apr 2006 14:37:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/regexp-vs-gnu-regexp/m-p/3776405#M99266</guid>
      <dc:creator>Marlou Everson</dc:creator>
      <dc:date>2006-04-25T14:37:30Z</dc:date>
    </item>
  </channel>
</rss>

