Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

case insensitive replace python

>>> import re
>>> insensitive_hippo = re.compile(re.escape('hippo'), re.IGNORECASE)
>>> insensitive_hippo.sub('giraffe', 'I want a hIPpo for my birthday')
'I want a giraffe for my birthday'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #case #insensitive #replace #python
ADD COMMENT
Topic
Name
5+7 =