マッチケースオプションを利用したいと思います。リスト内の文字列を検索するコードがあります。同じことを行うよりエレガントな方法があると思います。
searchString = "maki"
itemList = ["Maki", "moki", "maki", "Muki", "Moki"]
resultList = []
matchCase = 0
for item in itemList:
if matchCase:
if re.findall(searchString, item):
resultList.append(item)
else:
if re.findall(searchString, item, re.IGNORECASE):
resultList.append(item)
re.findall(searchString, item, flags = 2)
基本的に整数(2)なので使用できますre.IGNORECASE
が、どの数値が「マッチケース」オプションを意味するのかわかりません。