I use below regex to match the subsequent word after word I'm searching for, in this case the word I'm searching for is test
:
import re
chs = "this is a test Ab Here here big"
print(re.compile(r'test \w+').search(chs).group().split()[1])
From above Ab
is printed. How can I modify to return all subsequent words that have capital letter subsequent to word test
?
Update :
So in this case 'Ab Here' is returned.