Small exchange of good process:
I discover a bug in the test result field of "Search and Replace" module.
https://www.mobileread.com/forums/sh...d.php?t=335440
Moreover in your code there is a #FIXME: THE PROBLEM IS HERE, but I think it was rather the opposite:
s_r_do_regexp() has the expected behavior, is the test result field in
s_r_paint_results() which is not valid.