<?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: Please help me in forming Regex. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291839#M165015</link>
    <description>&lt;P&gt;That would be this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield "(&amp;lt;MyEmail&amp;gt;\&amp;lt;?[A-z0-9._%+-]+@[A-z0-9.-]+.[A-z]{2,63}\&amp;gt;?)(,|$)" max_match=0 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 Nov 2017 14:49:16 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-11-21T14:49:16Z</dc:date>
    <item>
      <title>Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291835#M165011</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;Please help me to extract the email ids which is not between &amp;lt;&amp;gt; angle brackets.&lt;/P&gt;

&lt;P&gt;Sample event:&lt;/P&gt;

&lt;P&gt;&lt;A href="mailto:someone@domain.com"&gt;someone@domain.com&lt;/A&gt;,&lt;A href="mailto:someone1@domain.com"&gt;someone1@domain.com&lt;/A&gt;,&lt;A href="mailto:someone2@domain.com"&gt;someone2@domain.com&lt;/A&gt;,&lt;A href="mailto:someone3@domain.com"&gt;someone3@domain.com&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;Not able to include a mail id between angle brackets.So consider a mail id is there in the above list between &amp;lt;&amp;gt; angle brackets.&lt;/P&gt;

&lt;P&gt;Expected output:&lt;/P&gt;

&lt;P&gt;&lt;A href="mailto:someone@domain.com"&gt;someone@domain.com&lt;/A&gt;,&lt;A href="mailto:someone1@domain.com"&gt;someone1@domain.com&lt;/A&gt;,&lt;A href="mailto:someone2@domain.com"&gt;someone2@domain.com&lt;/A&gt;,&lt;A href="mailto:someone3@domain.com"&gt;someone3@domain.com&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;The Regex:&lt;/P&gt;

&lt;P&gt;([A-z0-9._%+-]+@[A-z0-9.-]+.[A-z]{2,63}) this extracts all email ids.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 04:00:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291835#M165011</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2017-11-21T04:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291836#M165012</link>
      <description>&lt;P&gt;Ansif, you can use code button (one with &lt;CODE&gt;101010&lt;/CODE&gt;) to escape special characters. I hope following is the question you intended to ask.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;someone@domain.com,someone1@domain.com,&amp;lt;someone2@domain.com&amp;gt;,someone3@domain.com,
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So should your output also have angular bracket when you extract email?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([&amp;lt;A-z0-9._%+-]+@[A-z0-9.-]+.[A-z&amp;gt;]{2,63})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 06:09:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291836#M165012</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-21T06:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291837#M165013</link>
      <description>&lt;P&gt;Try this - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield "\&amp;lt;?(&amp;lt;MyEmail&amp;gt;[A-z0-9._%+-]+@[A-z0-9.-]+.[A-z]{2,63})\&amp;gt;?(,|$)" max_match=0  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should extract each email to a multi-value field, leaving out the angle brackets. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 13:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291837#M165013</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-21T13:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291838#M165014</link>
      <description>&lt;P&gt;@DalJeanis, while this should be confirmed by @ansif, I think his original query was already extracting emails correctly even if it was within angular brackets. I think what Ansif required was angular brackets to be included in the extraction not excluded. But due to the omissions in his post requirement is not quite clear. We can wait for him to respond back. &lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 13:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291838#M165014</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-11-21T13:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291839#M165015</link>
      <description>&lt;P&gt;That would be this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield "(&amp;lt;MyEmail&amp;gt;\&amp;lt;?[A-z0-9._%+-]+@[A-z0-9.-]+.[A-z]{2,63}\&amp;gt;?)(,|$)" max_match=0 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Nov 2017 14:49:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291839#M165015</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-21T14:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291840#M165016</link>
      <description>&lt;P&gt;Thanks Niket and Dal.&lt;/P&gt;

&lt;P&gt;I need to exclude  mail ids which is surrounded with angle brackets.like  &lt;A href="mailto:Ansif.d@splunk.com"&gt;Ansif.d@splunk.com&lt;/A&gt; and &lt;A href="mailto:thirich.89@splunk.com"&gt;thirich.89@splunk.com&lt;/A&gt; should be extracted in the below sample:&lt;/P&gt;

&lt;P&gt;&lt;A href="mailto:Ansif.d@splunk.com"&gt;Ansif.d@splunk.com&lt;/A&gt; &lt;A href="mailto:thirich.89@splunk.com"&gt;thirich.89@splunk.com&lt;/A&gt;  &lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 16:01:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291840#M165016</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2017-11-21T16:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291841#M165017</link>
      <description>&lt;P&gt;Not able to include a sample mail IDs with angle brackets&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 16:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291841#M165017</guid>
      <dc:creator>ansif</dc:creator>
      <dc:date>2017-11-21T16:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Please help me in forming Regex.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291842#M165018</link>
      <description>&lt;P&gt;Then that would be this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=myfield "(?&amp;lt;![A-z0-9._%+-\&amp;lt;])(&amp;lt;MyEmail&amp;gt;\&amp;lt;?[A-z0-9._%+-]+@[A-z0-9.-]+.[A-z]{2,63})(,|$)" max_match=0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This little beauty &lt;CODE&gt;(?&amp;lt;![A-z0-9._%+-\&amp;lt;])&lt;/CODE&gt; is a negative lookback that translates as &lt;BR /&gt;
" &lt;CODE&gt;(?&amp;lt;!&lt;/CODE&gt; that is not preceded by &lt;CODE&gt;[A-z0-9._%+-\&amp;lt;]&lt;/CODE&gt; any of the listed characters (including &lt;CODE&gt;&amp;lt;&lt;/CODE&gt;)"&lt;/P&gt;

&lt;P&gt;You can't use just &lt;CODE&gt;(?&amp;lt;!\&amp;lt;)&lt;/CODE&gt; to eliminate the open bracket because that would just drop the first character of the email address and take up extracting from the second one.&lt;/P&gt;

&lt;P&gt;You don't have to check for the close bracket at the end, because that address will already have been eliminated by not having anything before the &lt;CODE&gt;@&lt;/CODE&gt; sign.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Nov 2017 16:12:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Please-help-me-in-forming-Regex/m-p/291842#M165018</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-11-21T16:12:36Z</dc:date>
    </item>
  </channel>
</rss>

