<?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: Regex - Capture group without duplicating value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123713#M33403</link>
    <description>&lt;P&gt;max_match:&lt;/P&gt;

&lt;P&gt;| rex field=foo max_match=99 ....&lt;/P&gt;

&lt;P&gt;Unless I'm misunderstanding the question&lt;/P&gt;</description>
    <pubDate>Sat, 13 Sep 2014 01:05:25 GMT</pubDate>
    <dc:creator>twinspop</dc:creator>
    <dc:date>2014-09-13T01:05:25Z</dc:date>
    <item>
      <title>Regex - Capture group without duplicating value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123712#M33402</link>
      <description>&lt;P&gt;This is my string&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;1&amp;lt;/search&amp;gt; &amp;lt;search&amp;gt;4&amp;lt;/search&amp;gt; &amp;lt;search&amp;gt;2&amp;lt;/search&amp;gt; &amp;lt;search&amp;gt;5&amp;lt;/search&amp;gt; &amp;lt;search&amp;gt;3&amp;lt;/search&amp;gt; &amp;lt;search&amp;gt;6&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have the following rex command &lt;CODE&gt;rex field=a_field "&amp;lt;search&amp;gt;(?&amp;lt;TESTING&amp;gt;(.?))&amp;lt;/search&amp;gt;"&lt;/CODE&gt;&lt;BR /&gt;
This will only grab TESTING=1. I want to grab all the values.&lt;/P&gt;

&lt;P&gt;Using the rex command &lt;CODE&gt;rex field=a_field "&amp;lt;search&amp;gt;(?&amp;lt;TESTING&amp;gt;.*)&amp;lt;/search&amp;gt;"&lt;/CODE&gt;&lt;BR /&gt;
will grab everything in-between, including the brackets and search string.&lt;/P&gt;

&lt;P&gt;How would I make sure that I only grab the values between the bracketed strings?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Sep 2014 23:37:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123712#M33402</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-09-12T23:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Capture group without duplicating value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123713#M33403</link>
      <description>&lt;P&gt;max_match:&lt;/P&gt;

&lt;P&gt;| rex field=foo max_match=99 ....&lt;/P&gt;

&lt;P&gt;Unless I'm misunderstanding the question&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 01:05:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123713#M33403</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2014-09-13T01:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Capture group without duplicating value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123714#M33404</link>
      <description>&lt;P&gt;Perfect! Thank you for this parameter for the rex command.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 02:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123714#M33404</guid>
      <dc:creator>ben_leung</dc:creator>
      <dc:date>2014-09-13T02:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex - Capture group without duplicating value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123715#M33405</link>
      <description>&lt;P&gt;Additionally, take a look at non-greedy matching in regex. This will greedily match everything until the last closing tag:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;(?&amp;lt;TESTING&amp;gt;.*)&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;While this will non-greedily match only the bit until the first closing tag:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search&amp;gt;(?&amp;lt;TESTING&amp;gt;.*?)&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note the question mark after the asterisk.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Sep 2014 09:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-Capture-group-without-duplicating-value/m-p/123715#M33405</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-09-13T09:24:33Z</dc:date>
    </item>
  </channel>
</rss>

