I would like to match patterns from a given pattern library, returning the longest detected patterns.

However I only have the interleaved result of multiple parallel tasks in a log file, e.g. from multiple cores of a processor.

Is this a known application in data mining?

I thought of one solution with regex similar as [Regex subsequence matching](https://stackoverflow.com/questions/42555498/regex-subsequence-matching). However having a kind of distance metric to allow some fuzzyness would be nice, e.g. if one activity in a sequence would be missing.

[![sequence example](https://i.stack.imgur.com/jmblO.png)](https://i.stack.imgur.com/jmblO.png)