Reputation: 2449
I am trying to translate a regex from Python to C#, but i am having some problems as i keep getting the error Unrecognized grouping construct.
^(?:\[(?P<release_group>.+?)\][ ._-]*)
(?P<series_name>.+?)[ ._-]+
(?P<ep_ab_num>\d{1,3})
(-(?P<extra_ab_ep_num>\d{1,3}))?[ ._-]+?
(?:v(?P<version>[0-9]))?
(?:[\w\.]*)
(?:(?:(?:[\[\(])(?P<extra_info>\d{3,4}[xp]?\d{0,4}[\.\w\s-]*)(?:[\]\)]))|(?:\d{3,4}[xp]))
(?:[ ._]?\[(?P<crc>\w+)\])?
.*?
What is giving me the error Unrecognized grouping construct in this regex?
Upvotes: 1
Views: 3063
Reputation: 37066
(?P<groupname>...)
becomes (?<groupname>...)
in .NET regexes. Just remove the P
. Same semantics.
Upvotes: 6