Skip to main content
Solved

What is `?P` in parser syntax

  • February 7, 2024
  • 2 replies
  • 7 views

mountaincode2
Forum|alt.badge.img+8

In the following document:

https://cloud.google.com/chronicle/docs/reference/parser-syntax

there is the following pattern:

(?P<token>regex_pattern)
(?P<eventId>\\\\S+)

What does ?P mean here.

I was looking at the custom pattern secton of logstash, and it doesn't say anything about `?P`:

https://www.elastic.co/guide/en/logstash/current/plugins-filters-grok.html#_custom_patterns

So what is ?P in the context of Chronicle.

Thanks!

 

Best answer by herrald

It indicates a named capturing group in the re2 regular expression library.

2 replies

Forum|alt.badge.img+5
  • Bronze 3
  • Answer
  • February 7, 2024

It indicates a named capturing group in the re2 regular expression library.


mountaincode2
Forum|alt.badge.img+8
  • Author
  • Silver 2
  • February 7, 2024

ah okay. Thank you for leading me to an understanding.

I see more details here:

https://www.regular-expressions.info/refext.html