Regular expression itself:

^(?<team>.*?)\s[(](?<param>.*?)[)]$ 

The regular expression works with this format without problems: Франция (-2.5)

Today came the new format and the program does not understand it: Франция (Пары) (-2.5)

How to fix? It is necessary that only the information from the last brackets fall into the param group, and if there are other brackets they belonged to the team .

    2 answers 2

    Your first group is marked as lazy, because of this, everything will get into it up to the first bracket, but you need a greedy group - just remove it ? :

     ^(?<team>.*)\s[(](?<param>.*?)[)]$ 

    Well, I would rewrite it like this:

     ^(?<team>.+)\s*\((?<param>.+)\)$ 
    • Thank. Very helpful. - user10367234 4:05 pm
     @"^(?<team>.*[^\s])\s*\((?<param>.*?)\)$" 

    So rewrote the regular expression. Thanks to all.