Sorry, but the problem as such tickles me.
Could it be that there is something wrong with the preprocess_regexps?
I tried to simply replace A by B, using:
Code:
preprocess_regexps = [
(re.compile(r'A', re.DOTALL),
lambda match: 'B'),
and it didn't work.