Trying to create a RegEx for the following patterns

Posted by Travis on Stack Overflow See other posts from Stack Overflow or by Travis
Published on 2010-12-25T15:49:36Z Indexed on 2010/12/25 16:54 UTC
Read the original article Hit count: 238

Filed under:

Here are the patterns:

Red,Green (and so on...)
Red (+5.00),Green (+6.00) (and so on...)
Red (+5.00,+10.00),Green (+6.00,+20.00) (and so on...)
Red (+5.00),Green  (and so on...)

Each attribute ("Red,"Green") can have 0, 1, or 2 modifiers (shown as "+5.00,+10.00", etc.).

I need to capture each of the attributes and their modifiers as a single string (i.e. "Red (+5.00,+10.00)", "Green (+6.00,+20.00)".

Help?

© Stack Overflow or respective owner

Related posts about regex