<?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 usage of ippRegExpReplace in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804488#M3492</link>
    <description>As least two unexpected behaviors are found so far:&lt;BR /&gt;
&lt;BR /&gt;
1).&lt;BR /&gt;
Before invoking ippRegExpReplace:&lt;BR /&gt;
&lt;BR /&gt;
 regex: "[BD]"; option: "g"; replacement: "##"; src: "ABCDE"; destLen: 14; numFinds: 3&lt;BR /&gt;
&lt;BR /&gt;
After invoking:&lt;BR /&gt;
&lt;BR /&gt;
 srcUsedLen: 1; numFinds: 2; dest: "A##C##E"; destUsedLen: 7&lt;BR /&gt;
&lt;BR /&gt;
The src string has been entirely parsed. I expected srcUsedLen to be 5.&lt;BR /&gt;
&lt;BR /&gt;
2).&lt;BR /&gt;
Before invoking:&lt;BR /&gt;
&lt;BR /&gt;
 regex: "([AB])([CD])([EF])"; option: "g"; replacement: "##"; src: "ACE"; destLen: 10; numFinds: 3&lt;BR /&gt;
&lt;BR /&gt;
After invoking:&lt;BR /&gt;
&lt;BR /&gt;
 srcUsedLen: 3; numFinds: 0;&lt;BR /&gt;
&lt;BR /&gt;
The pre-allocated Finds array is too small to fit all results, but I 
would expect numFinds after invoking to be 3 - fill what can fit. Under 
current behavior, I have no way to tell the difference of this case from
 no matching - e.g. use "XYZ" as src string, the result is identical.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
-Evan</description>
    <pubDate>Fri, 22 Oct 2010 02:18:55 GMT</pubDate>
    <dc:creator>evanyan</dc:creator>
    <dc:date>2010-10-22T02:18:55Z</dc:date>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804485#M3489</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I want to use ippRegExpReplace() to replace ALL matched sub strings in the src string, but didn't find a elegant way to do it.&lt;BR /&gt;&lt;BR /&gt;From the doc, I see ippRegExpReplace() doesn't allocate memory for the dest string and IppRegExpFind array. So I have to test again and again to see whether the result can fit into the allocated memory. Following is how I did.&lt;BR /&gt;&lt;BR /&gt;do { // loop until we got enough memory for dest and finds&lt;BR /&gt;&lt;BR /&gt; if (destUsedLen == destLen) {&lt;BR /&gt; destLen *= 2; // expand the size by 2&lt;BR /&gt; delete[] dest;&lt;BR /&gt; dest = new char[destLen];&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; if (numFinds == findsLen) {&lt;BR /&gt; findsLen *= 2;&lt;BR /&gt; delete[] f;&lt;BR /&gt; f = new IppRegExpFind[findsLen];&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; srcLen = origStrLen;&lt;BR /&gt; destUsedLen = destLen;&lt;BR /&gt; numFinds = findsLen;&lt;BR /&gt; status = ippsRegExpReplace_8u(srcStr, &amp;amp;srcLen, destStr, &amp;amp;destUsedLen, f, &amp;amp;numFinds, regexState, replaceState);&lt;BR /&gt;&lt;BR /&gt; } while ((status == ippStsNoErr) &amp;amp;&amp;amp; (numFinds &amp;gt; 0) &amp;amp;&amp;amp; ((numFinds &amp;gt;= findsLen) || (destUsedLen &amp;gt;= destLen)));&lt;BR /&gt;&lt;BR /&gt;Is that the right (but ugly) way? Or did I miss anything?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Evan</description>
      <pubDate>Tue, 19 Oct 2010 11:40:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804485#M3489</guid>
      <dc:creator>evanyan</dc:creator>
      <dc:date>2010-10-19T11:40:33Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804486#M3490</link>
      <description>Hi,&lt;BR /&gt;It is better to check srcLen param. On function output it holds how many source elements was searched. If it less then origStrLen and all dst buffer is filled than you can move pSrc pointer to the srcLen bytes and repeate the replacement. In that case no need to start the replecement from origin of source string.&lt;BR /&gt;&lt;BR /&gt;Igor S. Belyakov</description>
      <pubDate>Thu, 21 Oct 2010 06:41:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804486#M3490</guid>
      <dc:creator>Igor_B_Intel1</dc:creator>
      <dc:date>2010-10-21T06:41:25Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804487#M3491</link>
      <description>Hi Igor S.,&lt;BR /&gt;&lt;BR /&gt;Thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;As my testing, when the match result cannot fit into IppRegExpFind array, srcLen will also equal to origStrLen.&lt;BR /&gt;&lt;BR /&gt;Could you please tell me what are the values of srcUsedLen, dstUseLen, numFinds in the following cases?&lt;BR /&gt;&lt;BR /&gt;o dst buffer is too small to fit in, but IppRegExpFind array is big enough;&lt;BR /&gt;o IppRegExpFind array is too small to fit in, but dst buffer is big enough;&lt;BR /&gt;o both of IppRegExpFind array and dst buffer are too small to fit in.&lt;BR /&gt;&lt;BR /&gt;The answers to above cases should really be documented. I've spent a lot of time struggling with the replace API.&lt;BR /&gt;&lt;BR /&gt;It turns out my previous approach also doesn't work, because I found that when IppRegExpFind array is too small to fit, numFinds is 0. So far, I haven't figure out a way to use ippRegExpReplace() to replace all matched substrings given above cases.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Evan&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2010 13:45:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804487#M3491</guid>
      <dc:creator>evanyan</dc:creator>
      <dc:date>2010-10-21T13:45:52Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804488#M3492</link>
      <description>As least two unexpected behaviors are found so far:&lt;BR /&gt;
&lt;BR /&gt;
1).&lt;BR /&gt;
Before invoking ippRegExpReplace:&lt;BR /&gt;
&lt;BR /&gt;
 regex: "[BD]"; option: "g"; replacement: "##"; src: "ABCDE"; destLen: 14; numFinds: 3&lt;BR /&gt;
&lt;BR /&gt;
After invoking:&lt;BR /&gt;
&lt;BR /&gt;
 srcUsedLen: 1; numFinds: 2; dest: "A##C##E"; destUsedLen: 7&lt;BR /&gt;
&lt;BR /&gt;
The src string has been entirely parsed. I expected srcUsedLen to be 5.&lt;BR /&gt;
&lt;BR /&gt;
2).&lt;BR /&gt;
Before invoking:&lt;BR /&gt;
&lt;BR /&gt;
 regex: "([AB])([CD])([EF])"; option: "g"; replacement: "##"; src: "ACE"; destLen: 10; numFinds: 3&lt;BR /&gt;
&lt;BR /&gt;
After invoking:&lt;BR /&gt;
&lt;BR /&gt;
 srcUsedLen: 3; numFinds: 0;&lt;BR /&gt;
&lt;BR /&gt;
The pre-allocated Finds array is too small to fit all results, but I 
would expect numFinds after invoking to be 3 - fill what can fit. Under 
current behavior, I have no way to tell the difference of this case from
 no matching - e.g. use "XYZ" as src string, the result is identical.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
-Evan</description>
      <pubDate>Fri, 22 Oct 2010 02:18:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804488#M3492</guid>
      <dc:creator>evanyan</dc:creator>
      <dc:date>2010-10-22T02:18:55Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804489#M3493</link>
      <description>Forgot to mention, I'm using IPP 7 Beta.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;-Evan</description>
      <pubDate>Fri, 22 Oct 2010 03:13:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804489#M3493</guid>
      <dc:creator>evanyan</dc:creator>
      <dc:date>2010-10-22T03:13:26Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804490#M3494</link>
      <description>Could someone confirm that whether they're bugs of IPP? Thanks!</description>
      <pubDate>Fri, 29 Oct 2010 12:34:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804490#M3494</guid>
      <dc:creator>evanyan</dc:creator>
      <dc:date>2010-10-29T12:34:39Z</dc:date>
    </item>
    <item>
      <title>usage of ippRegExpReplace</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804491#M3495</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Thaks for reporting issue.We were able to reproduce the problem and will investigate it further. We will update you once we have results.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt; Vladimir</description>
      <pubDate>Fri, 29 Oct 2010 13:59:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/usage-of-ippRegExpReplace/m-p/804491#M3495</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2010-10-29T13:59:59Z</dc:date>
    </item>
  </channel>
</rss>

