Splunk Search

What Is Purpose Of Leading P Argument In Field Extraction Regex?


When extracting a field using a regex, what does the P argument do (the P character between the question mark and the field name)? I have seen examples with and without this argument, but I don't see any obvious difference in the results. For example:
(?i) Finished (?P.+)
(?i) Finished (?.+)

I looked in the Splunk manual and on the Answers site but couldn't find any description of this argument. Apologies if I'm missing something obvious.

Tags (1)
0 Karma


The P was part of the syntax when Python first introduced the idea of naming a capture in regular expressions. However, the P is not part of the syntax in some other flavors of regular expressions, most notably Microsoft .NET.

Splunk supports the syntax both ways.


Great - thanks for the quick response!

0 Karma
Get Updates on the Splunk Community!

2024 Splunk Career Impact Survey | Earn a $20 gift card for participating!

Hear ye, hear ye! The time has come again for Splunk's annual Career Impact Survey!  We need your help by ...

Optimize Cloud Monitoring

  TECH TALKS Optimize Cloud Monitoring Tuesday, August 13, 2024  |  11:00AM–12:00PM PST   Register to ...

What's New in Splunk Cloud Platform 9.2.2403?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2403! Analysts can ...