Compilation Flags

Let's explore each compilation flag and its uses.

There are seven compilation flags included in Python 3 that can change how our compiled pattern behaves. Let’s go over what each of them does, and then we will look at how to use a compilation flag.

re.A / re.ASCII

The ASCII flag tells Python to only match against ASCII instead of using full Unicode matching when coupled with the following escape codes: w, W, b, B, d, D, s and S. There is a re.U / re.UNICODE flag too that is for backward ...