<?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: Why is the following regex expression not matching as expected? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376589#M110568</link>
    <description>&lt;P&gt;We can't read your &lt;CODE&gt;rex&lt;/CODE&gt; string because the forum mangled it.  To prevent this, put code, HTML, and SPL inside backticks or use the code button (101010).&lt;/P&gt;

&lt;P&gt;Backslashes require extra escape characters in regex strings within SPL.  Try &lt;CODE&gt;rex field=user "\\\(?&amp;lt;Result&amp;gt;.*)"&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Sep 2018 18:56:18 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2018-09-17T18:56:18Z</dc:date>
    <item>
      <title>Why is the following regex expression not matching as expected?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376587#M110566</link>
      <description>&lt;P&gt;I have a field user= xyz\user11 and i need to match user11 ignoring xyz in the user filed &lt;/P&gt;

&lt;P&gt;below is the regex expression we have been trying but it gives error as unmatched parenthesis or some other and Result field is not available in the logs if it runs successfully .&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=user (?\w+\\(\w+))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Sep 2018 18:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376587#M110566</guid>
      <dc:creator>SunilMaharishi</dc:creator>
      <dc:date>2018-09-17T18:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the following regex expression not matching as expected?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376588#M110567</link>
      <description>&lt;P&gt;You have to specify which field to extract the value to. Also, the backslash(\) before opening parenthesis in your query escapes the ( which causes Splunk to give an error of unmatched parenthesis. You need to escape the backslash with \.&lt;/P&gt;

&lt;P&gt;Try this: &lt;CODE&gt;rex field=user "\w+\\\(?&amp;lt;user_name&amp;gt;\w+)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 18:55:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376588#M110567</guid>
      <dc:creator>pjnike</dc:creator>
      <dc:date>2018-09-17T18:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the following regex expression not matching as expected?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376589#M110568</link>
      <description>&lt;P&gt;We can't read your &lt;CODE&gt;rex&lt;/CODE&gt; string because the forum mangled it.  To prevent this, put code, HTML, and SPL inside backticks or use the code button (101010).&lt;/P&gt;

&lt;P&gt;Backslashes require extra escape characters in regex strings within SPL.  Try &lt;CODE&gt;rex field=user "\\\(?&amp;lt;Result&amp;gt;.*)"&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 18:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376589#M110568</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-09-17T18:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is the following regex expression not matching as expected?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376590#M110569</link>
      <description>&lt;P&gt;that was mistyped  fieldname was specified  though &lt;/P&gt;

&lt;P&gt;but it is working now thank you &lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 20:49:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-the-following-regex-expression-not-matching-as-expected/m-p/376590#M110569</guid>
      <dc:creator>SunilMaharishi</dc:creator>
      <dc:date>2018-09-17T20:49:49Z</dc:date>
    </item>
  </channel>
</rss>

