<?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 to match everything between the 25th and 130th characters in a line in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70094#M17559</link>
    <description>&lt;P&gt;The regex you provided will first match characaters 1-25. The capturing group (while incomplete) would then catch the next 130 characters, not upto the 130th character. &lt;/P&gt;

&lt;P&gt;Try this: &lt;CODE&gt;^.{25}(?P&amp;lt;fieldname&amp;gt;.{1,105})&lt;/CODE&gt;. This should grab everything from 25-130, and will also grab anything that may be less than 130.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Dec 2012 17:34:35 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2012-12-20T17:34:35Z</dc:date>
    <item>
      <title>regex to match everything between the 25th and 130th characters in a line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70093#M17558</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am trying to craft a regex to match everything between the 25th and 130th character in a line.  I am having no success.  Someone suggested  &lt;CODE&gt;^.{25} (?P&amp;lt;FIELDNAME&amp;gt;.{130}&lt;/CODE&gt;  but that doesn't work at all.  Does anyone know how to create this regex?&lt;/P&gt;

&lt;P&gt;Thank you! &lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 16:52:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70093#M17558</guid>
      <dc:creator>mritenburg</dc:creator>
      <dc:date>2012-12-20T16:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: regex to match everything between the 25th and 130th characters in a line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70094#M17559</link>
      <description>&lt;P&gt;The regex you provided will first match characaters 1-25. The capturing group (while incomplete) would then catch the next 130 characters, not upto the 130th character. &lt;/P&gt;

&lt;P&gt;Try this: &lt;CODE&gt;^.{25}(?P&amp;lt;fieldname&amp;gt;.{1,105})&lt;/CODE&gt;. This should grab everything from 25-130, and will also grab anything that may be less than 130.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 17:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70094#M17559</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-12-20T17:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: regex to match everything between the 25th and 130th characters in a line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70095#M17560</link>
      <description>&lt;P&gt;Depending on what you are trying to accomplish, you may be better off using the eval substr() function. For example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval newField=substr(field, 26, 104)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Otherwise, you can use this regex to extract the same thing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^.{25}(?P&amp;lt;newField&amp;gt;.{0,105})
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2012 18:09:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70095#M17560</guid>
      <dc:creator>rtadams89</dc:creator>
      <dc:date>2012-12-20T18:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: regex to match everything between the 25th and 130th characters in a line</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70096#M17561</link>
      <description>&lt;P&gt;This works perfectly  ^.{25}(?P&lt;FIELDNAME&gt;.{1,105}). &lt;/FIELDNAME&gt;&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2012 18:11:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-to-match-everything-between-the-25th-and-130th-characters/m-p/70096#M17561</guid>
      <dc:creator>mritenburg</dc:creator>
      <dc:date>2012-12-20T18:11:37Z</dc:date>
    </item>
  </channel>
</rss>

