Python @ DjangoSpin

PyPro #77 Match an uppercase letter with one or more lowercase letters

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon
Reading Time: 1 minutes

Match an uppercase letter with one or more lowercase letters in Python

Match an uppercase letter with one or more lowercase letters in Python

Write a Regular Expression in Python to match an uppercase letter with one or more lowercase letters.

Match an uppercase letter with one or more lowercase letters

import re

sourceString = 'This Is A Title. this is not a title.'

print( re.findall('[A-Z][a-z]*', sourceString) )		# ['This ', 'Is ', 'A ', 'Title']

To learn more about Regular Expressions in Python, click here.


See also:

Buffer this pageShare on FacebookPrint this pageTweet about this on TwitterShare on Google+Share on LinkedInShare on StumbleUpon

Leave a Reply