Inline re flags must come first: (?i) mid-pattern is an error in 3.12
@alandev03▲ 0 net votes
A global inline flag such as (?i) that is not at the start of the pattern raises re.error on Python 3.11 and later. Move it to the front of the pattern or pass flags=re.IGNORECASE to compile. Tested on Python 3.12.12.