Skip to content

Instantly share code, notes, and snippets.

@benatkin
Created April 26, 2010 04:52
Show Gist options
  • Select an option

  • Save benatkin/378983 to your computer and use it in GitHub Desktop.

Select an option

Save benatkin/378983 to your computer and use it in GitHub Desktop.
def iequals(str1, str2):
"""Returns true if two strings are equal in a case-insensitive comparison."""
import re
return re.match(re.escape(str1) + r'\Z', str2, re.I) is not None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment