http://qs1969.pair.com?node_id=483463


in reply to How to use regular expression for this?

This looks like what Algorithm::Diff's LCS (longest common subsequence) does. It even has an optimized LCS_length().

- tye