Q:

stringr: how to recover sentences from a string that was derived from concatenating those sentences

I have three units strings which each contain commas (","). Each unit string also begins with a capital letter. These strings have been concatenated in a paste0() fashion such that a comma (",") and no spaces separate the original unit strings. 
I provide R code below to give more context to my question:
string1 <- "I like dogs, cats, and pigs"
string2 <- "Community health centers, businesses, stores"
string3 <- "Jamie Foxx sings, dances, and acts"
string_combined <- paste0(string1,",",string2,",",string3)
string_combined

[1] "I like dogs, cats, and pigs,Community health centers, businesses, stores,Jamie Foxx sings, dances, and acts"

As can be seen from the console output above, the strings meet at the junction of:

last lowercase letter of first string
a comma
first uppercase letter of the 2nd string
no spaces at the junction of unit strings

I have used the str_view_all(string = string_combined,pattern = ",\\S") to locate where the strings join, but I am not sure how to recover the original unit strings (string1, string2, string3). 
Question: How can I recover the original unit strings from the larger string (string_combined), which is a concatenation of the unit strings, recognizing that the original unit strings, which themselves contain commas, are separated by commas in the concatenated string.
Perhaps someone might be able to help answer my question.  Thank you.

A:

You can use the pattern described above in strsplit
strsplit(string_combined, "(?<=[a-z]),(?=[A-Z])",perl = TRUE)[[1]]

#[1] "I like dogs, cats, and pigs"   "Community health centers, businesses, stores"
#[3] "Jamie Foxx sings, dances, and acts"   

and similar with stringr::str_split
stringr::str_split(string_combined, "(?<=[a-z]),(?=[A-Z])")[[1]] 

This splits the string at lower case letter(a-z), followed by comma (,), followed by upper-case letter (A-Z).     

