Detect and Test Regular Sequences and Subsequences