<?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 regexp_count seems to not work as it should in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104771#M2719</link>
    <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The below SQL's should give different answers as regexp rules state that * is a special character which needs to be escaped with \ to be considered as a literal string. This second should literally match for A*B and return 2 but it is also taking AB as a match and returning 3&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsABreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsABreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A\*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 08 Jan 2025 19:41:50 GMT</pubDate>
    <dc:creator>Rajasql</dc:creator>
    <dc:date>2025-01-08T19:41:50Z</dc:date>
    <item>
      <title>regexp_count seems to not work as it should</title>
      <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104771#M2719</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The below SQL's should give different answers as regexp rules state that * is a special character which needs to be escaped with \ to be considered as a literal string. This second should literally match for A*B and return 2 but it is also taking AB as a match and returning 3&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsABreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsABreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A\*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2025 19:41:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104771#M2719</guid>
      <dc:creator>Rajasql</dc:creator>
      <dc:date>2025-01-08T19:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: regexp_count seems to not work as it should</title>
      <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104775#M2721</link>
      <description>&lt;P&gt;Is this being executed on SQL editor or on a Notebook?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:09:17 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104775#M2721</guid>
      <dc:creator>Walter_C</dc:creator>
      <dc:date>2025-01-08T20:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: regexp_count seems to not work as it should</title>
      <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104778#M2723</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/99841"&gt;@Rajasql&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Try this way (it worked for me in a Databricks notebook and it returns 2):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsABreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A\\*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:17:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104778#M2723</guid>
      <dc:creator>PabloCSD</dc:creator>
      <dc:date>2025-01-08T20:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: regexp_count seems to not work as it should</title>
      <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104779#M2724</link>
      <description>&lt;P&gt;It is being executed on a notebook.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:20:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104779#M2724</guid>
      <dc:creator>Rajasql</dc:creator>
      <dc:date>2025-01-08T20:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: regexp_count seems to not work as it should</title>
      <link>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104780#M2725</link>
      <description>&lt;P&gt;It fails if this is the code and returns 3 which it should not.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;SPAN&gt; regexp_count(&lt;/SPAN&gt;&lt;SPAN&gt;'nA*BsA\*BreA*Bthe'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'A\\*B'&lt;/SPAN&gt;&lt;SPAN&gt;) str_cnt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is what I am following for Regexp standards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;A href="https://www.regular-expressions.info/quickstart.html" target="_blank"&gt;https://www.regular-expressions.info/quickstart.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 08 Jan 2025 20:22:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/regexp-count-seems-to-not-work-as-it-should/m-p/104780#M2725</guid>
      <dc:creator>Rajasql</dc:creator>
      <dc:date>2025-01-08T20:22:40Z</dc:date>
    </item>
  </channel>
</rss>

