Meaning of ?P in string pattern

Screen Link:
https://app.dataquest.io/m/346/working-with-strings-in-pandas/10/extracting-more-than-one-group-of-patterns-from-a-series

My Code:
pattern = r"(?P<First_Year>[1-2][0-9]{3})/?(?P<Second_Year>[0-9]{2})?"

Replace this line with your code

What I expected to happen:

What actually happened:

Replace this line with the output/error

what is the meaning of ?P<First_Year> ? I don’t understand why we need it to solve the problem ?

I would recommend first going through, in detail, the previous Step of that same Mission. It explains what ?P<...> is.

Kindly check this link(Named capturing group concept)