What is `?P` in parser syntax

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!

 

Solved Solved
1 2 150
1 ACCEPTED SOLUTION

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

View solution in original post

2 REPLIES 2

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

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

I see more details here:

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