re.DEBUG
The re.DEBUG search modifier displays debug information regarding the function being executed.
The re.DEBUG search modifier takes no arguments.
If we start from the following search and text pattern:
text = 'my cat and your cats are pretty'
...we can get debug information about the execution of the re.search function with the following code:
SUBPATTERN 1 0 0
LITERAL 99
LITERAL 97
LITERAL 116
MAX_REPEAT 0 1
LITERAL 115
0. INFO 12 0b1 3 4 (to 13)
prefix_skip 0
prefix [0x63, 0x61, 0x74] ('cat')
overlap [0, 0, 0]
13: MARK 0
15. LITERAL 0x63 ('c')
17. LITERAL 0x61 ('a')
19. LITERAL 0x74 ('t')
21. MARK 1
23. REPEAT_ONE 6 0 1 (to 30)
27. LITERAL 0x73 ('s')
29. SUCCESS
30: SUCCESS
<re.Match object; span=(3, 6), match='cat'>