On 10/7/2018 12:32 AM, Ram Rachum wrote: > Does that mean I'll have to write that character-by-character algorithm? I would not be surprised if you could make use of str.index, which scans at C speed. See my answer to Nathaniel. -- Terry Jan Reedy