Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import re
2
3_pattern_test_data = []
4
5
6def _define_pattern(pattern, example, *args):
7 """Compile a regex and store an example pattern for testing."""
8 regex = re.compile(pattern, *args)
9 _pattern_test_data.append((regex, example))
10 return regex