Issue 21977:  Minor improvements to the regexes in the tokenizer example.
merge
Call PyErr_NoMemory() when PyMem_Malloc() fails.
Call PyErr_NoMemory() when PyMem_Malloc() fails.