$ java RegexTestHarness
Enter your regex: (\d+) (.+?)(?:, (?=\d)|, and|and (?=\d)|$)
Enter input string to search: 5 stars and 5 lines
I found the text "5 stars and " starting at index 0 and ending at index 12.
group(1) = 5
group(2) = stars
I found the text "5 lines" starting at index 12 and ending at index 19.
group(1) = 5
group(2) = lines
Enter your regex: (\d+) (.+?)(?:, (?=\d)|, and|and (?=\d)|$)
Enter input string to search: 5 stars, 5 lines, and 5 star charts
I found the text "5 stars, " starting at index 0 and ending at index 9.
group(1) = 5
group(2) = stars
I found the text "5 lines, and" starting at index 9 and ending at index 21.
group(1) = 5
group(2) = lines
I found the text "5 star charts" starting at index 22 and ending at index 35.
group(1) = 5
group(2) = star charts
Enter your regex: (\d+) (.+?)(?:, (?=\d)|, and|and (?=\d)|$)
Enter input string to search: 1 Rock and Roll Legend and 1 1337 7r0uZ0RZ
I found the text "1 Rock and Roll Legend and " starting at index 0 and ending at index 27.
group(1) = 1
group(2) = Rock and Roll Legend
I found the text "1 1337 7r0uZ0RZ" starting at index 27 and ending at index 42.
group(1) = 1
group(2) = 1337 7r0uZ0RZ
Enter your regex: (\d+) (.+?)(?:, (?=\d)|, and|and (?=\d)|$)
Enter input string to search: 1 heart of rock and roll, 1 Rock and Roll Legend, and 1 1337 7r0uZ0RZ
I found the text "1 heart of rock and roll, " starting at index 0 and ending at index 27.
group(1) = 1
group(2) = heart of rock and roll
I found the text "1 Rock and Roll Legend, and" starting at index 27 and ending at index 54.
group(1) = 1
group(2) = Rock and Roll Legend
I found the text "1 1337 7r0uZ0RZ" starting at index 55 and ending at index 70.
group(1) = 1
group(2) = 1337 7r0uZ0RZ