Python provides several options that you can use when searching. Of these, the only one that you
are likely to use is IGNORECASE:
import re
substring = 'xyz'
search = re.search(substring,'XYZ HOSPITAL',re.IGNORECASE)
Here, IGNORECASE specifies that capitalization is to be ignored when matching: for example, A will
match a or A. In this example, xyz can match xyz, XYZ, XyZ, or any combination
of uppercase and lowercase letters.
For a complete list of search options, see the Compilation Flags section of the
Regular Expression HOWTO section
of the Python documentation.