I want to find passages where the sequence of actions deviates from the given pattern and cannot find a smart solution for this, although the problem sounds very simple.
The purpose of the template is to describe somehow the usual sequence. More specifically: "What actions should or should not be contained in the sequence of actions and in what order?" Then I want to combine the sequence of actions with the template and detect deviations and their locations.
My first approach was to do this with regular expressions. Here is an example:
Example 1:
Pattern: A.*BC
Sequence: AGDBC (matches)
Sequence: AGEDC (does not match)
Example 2:
Pattern: ABCD
Sequence: ABD (does not match)
Sequence: ABED (does not match)
Sequence: ABCED (does not match)
Example 3:
Pattern: ABCDEF
Sequence: ABXDXF (does not match)
, , . , , . , , . . .
, , ANTLR. , .
. ?