Open this example in the interactive library
Source code
import re
pattern = re.compile(r'python', re.IGNORECASE)
print(bool(pattern.search('Learn PYTHON')))Sample output
True

Compile a reusable pattern. A self-contained example using the Python standard library.
Open this example in the interactive library
import re
pattern = re.compile(r'python', re.IGNORECASE)
print(bool(pattern.search('Learn PYTHON')))True