I have a list of names that I want to match case insensitive, is there a way to do it without using a loop like below?
a = [\'name1\', \'name2\', \'name3\']
Adding onto what Rasmuj said, escape any user-input like so
import re result = Name.objects.filter(name__iregex=r'(' + '|'.join([re.escape(n) for n in a]) + ')')