The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Do A Case Insensitive RexEx Search In Python

TODO: Pull subtitle into page object
Code
import re

alfa  = re.search('test', 'TeSt')
bravo = re.search('test', 'TeSt', re.IGNORECASE)

print(alfa)
print(bravo)
Results
None
<re.Match object; span=(0, 4), match='TeSt'>

Notes

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Do A Case Insensitive RexEx Search In Python

Use the `re.IGNORECASE`` flag to do case insenstive
searches. For example, here's the same search 
with and without it:

-- code
-- python

import re

alfa  = re.search('test', 'TeSt')
bravo = re.search('test', 'TeSt', re.IGNORECASE)

print(alfa)
print(bravo)


-- results/

None
<re.Match object; span=(0, 4), match='TeSt'>

-- /results

-- notes

- When doing a `.sub()`, the `flags` key should
be called explicietly like:

re.sub('test', 'TeSt', 'source value', flags=re.IGNORECASE)


-- categories
-- Python 

-- metadata
-- date: 2021-04-24 13:23:32
-- id: 01f42egv
-- status: published
-- type: post
-- site: aws