>>> w = 'AbcDefgHijkL' >>> r = re.findall('([AZ])', word) >>> r ['A', 'D', 'H', 'L']
It can give you all the letters in caps in one word ... Just share the idea
>>> r = re.findall('([AZ][az]+)', w) >>> r ['Abc', 'Defg', 'Hijk']
All the words starting with the letter Caps will be given above. Note: the latter is not recorded, since it does not make a word, but even this can be fixed
>>> r = re.findall('([AZ][az]*)', w) >>> r ['Abc', 'Defg', 'Hijk', 'L']
This will return true if the capital letter is in the word:
>>> word = 'abcdD' >>> bool(re.search('([AZ])', word))
Arindam roychowdhury
source share