@res = $_ =~/(\d{4}-\d\d-\d\d).*dates processed: ((\d{4}-\d\d-\d\d,? ?)*) # almost gets it but now have one too many results in the tail # due to the nested braces