I know that you can use the ctypes library to perform case insensitive comparisons on strings, however I would like to perform case insensitive replacement too. Currently the only way I know to do this is with Regex's and it seems a little poor to do so via that.
Is there a case insensitive version of replace()?
You can supply the flag re.IGNORECASE to functions in the re module as described in the docs.
matcher = re.compile(myExpression, re.IGNORECASE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With