java parse regex multiple capture groups

Hi I need to be able to handle both of these scenarios

John, party of 4

william, party of 6 dislikes John, jeff

What I want to capture is

From string 1: John, 4

From String 2: william, 6, john, jeff

I'm pretty stumped at how to achieve this

I know that ([^,])+ gives me the first group (just the name before the comma, without including the comma) but I have no clue on how to concatenate the other portion of the expression....

Read More »

By: StackOverFlow - Sunday, 15 April

Related Posts