you don't need a loop for this or any of the intermediate code. Apply the pattern on line 1760 to the string on 1757 and yield the test directly.