I am trying to extract matching groups from a Python string but facing issues.
The string looks like below.
1. TITLE ABC Contents of title ABC and some other text 2. TITLE BCD This would have contents on
title BCD and maybe something else 3. TITLE CDC Contents of title cdc
And i would need anything starting with a number and capital letters as the title and extract the contents in that title.
This is the output I am expecting.
1. TITLE ABC Contents of title ABC and some other text
2. TITLE BCD This would have contents on title BCD and maybe something else
3. TITLE CDC Contents of title cdc
I tried with the below regex
(\d\.\s[A-Z\s]*\s)
and get the below.
1. TITLE ABC
2. TITLE BCD
3. TITLE CDC
If i try adding .* at the end of the regex the matching groups are affected. I think I am missing something simple here. Tried with whatever I knew but couldn't solve it.
Any help here is appreciated.

