<?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>question Re: Not able to understand the Regexp_extract sysntax, in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147599#M35852</link>
    <description>&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;regexp_extract(string subject, string pattern, int index)&lt;/P&gt;&lt;P&gt;Returns the string extracted using the pattern. For example, 
regexp_extract('foothebar', 'foo(.*?)(bar)', 2) returns 'bar.' Note that
 some care is necessary in using predefined character classes: using 
'\s' as the second argument will match the letter s; '\\s' is necessary 
to match whitespace, etc. The 'index' parameter is the Java regex 
Matcher group() method index. See docs/api/java/util/regex/Matcher.html 
for more information on the 'index' or Java regex group() method.&lt;/P&gt;&lt;P&gt;In your case it will return everything from the start until the first comma (comma included). For example if your text is "abc,def,geh", it will return "abc,".&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2016 14:55:58 GMT</pubDate>
    <dc:creator>pvillard</dc:creator>
    <dc:date>2016-07-26T14:55:58Z</dc:date>
    <item>
      <title>Not able to understand the Regexp_extract sysntax,</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147598#M35851</link>
      <description>&lt;P&gt;regexp_extract(col_value,'^(?:([^,]*),?){1}',1)&lt;/P&gt;,</description>
      <pubDate>Tue, 26 Jul 2016 14:06:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147598#M35851</guid>
      <dc:creator>sachin_mittal04</dc:creator>
      <dc:date>2016-07-26T14:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to understand the Regexp_extract sysntax,</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147599#M35852</link>
      <description>&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF&lt;/A&gt;&lt;/P&gt;&lt;P&gt;regexp_extract(string subject, string pattern, int index)&lt;/P&gt;&lt;P&gt;Returns the string extracted using the pattern. For example, 
regexp_extract('foothebar', 'foo(.*?)(bar)', 2) returns 'bar.' Note that
 some care is necessary in using predefined character classes: using 
'\s' as the second argument will match the letter s; '\\s' is necessary 
to match whitespace, etc. The 'index' parameter is the Java regex 
Matcher group() method index. See docs/api/java/util/regex/Matcher.html 
for more information on the 'index' or Java regex group() method.&lt;/P&gt;&lt;P&gt;In your case it will return everything from the start until the first comma (comma included). For example if your text is "abc,def,geh", it will return "abc,".&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 14:55:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147599#M35852</guid>
      <dc:creator>pvillard</dc:creator>
      <dc:date>2016-07-26T14:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to understand the Regexp_extract sysntax,</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147600#M35853</link>
      <description>&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;thanks for look into my query. Yes it is very much clear to me except one doubt .&lt;/P&gt;&lt;P&gt; i am not clear with ?: in my query and (.*?) in your example.&lt;/P&gt;&lt;P&gt;Sorry for asking very basic things but if you could give me some briefthat can be helpful in writing some other functions.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sachin Mittal&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:10:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147600#M35853</guid>
      <dc:creator>sachin_mittal04</dc:creator>
      <dc:date>2016-07-26T15:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to understand the Regexp_extract sysntax,</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147601#M35854</link>
      <description>&lt;P&gt;I'd recommend you having a look to this site : &lt;A href="http://regexr.com/"&gt;http://regexr.com/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can enter your regular expression and then click on "Explain" (at the bottom) to have a complete explanation about the regular expression you entered. It also gives you the possibility to test your regular expression with any text you want.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:17:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147601#M35854</guid>
      <dc:creator>pvillard</dc:creator>
      <dc:date>2016-07-26T15:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to understand the Regexp_extract sysntax,</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147602#M35855</link>
      <description>&lt;P&gt;Hi Pierre,&lt;/P&gt;&lt;P&gt;Very nice of you.&lt;/P&gt;&lt;P&gt;Thanks a lot. I visited the site and cleared my most of the doubts.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sachin Mittal&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2016 16:52:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Not-able-to-understand-the-Regexp-extract-sysntax/m-p/147602#M35855</guid>
      <dc:creator>sachin_mittal04</dc:creator>
      <dc:date>2016-07-26T16:52:40Z</dc:date>
    </item>
  </channel>
</rss>

