Computer >> Computer tutorials >  >> Programming >> Python

How to match any one uppercase character in python using Regular Expression?


The following code matches and prints any uppercase character in the given string using python regular expression as follows.

Example

import re
foo = 'MozamBiQuE'
match = re.findall(r'[A-Z]', foo)
print match

Output

This gives the output

['M', 'B', 'Q', 'E']