Create regex-like (run length encoding) of string s for blocks of a given length k
I am looking for python code to perform a run length encoding to obtain a regex-like summary of a string s, for a known length k for the blocks. How should I tackle this?