I hope the title is sufficient in explaining what I need help with, but I'll explain it in more detail.

I have a text file which contains 7 character long strings on each line. The strings look like this:

```
aaaaaad
aaabbbd
AAaa123
AkLmbB3

```

This file has a few hundred thousand of these 7 character long strings and I need to remove any line which contains too many of the same character that is in sequence. For example:

```
aaaaLu1 <-- Remove this, because there is 4 `a` characters next to each other.

aaBaa1b <-- Keep this line

bbbb1Lk <-- Remove this line, because there is 4 `b` characters next to each other.

bababab <-- Keep this line, as the `b` characters aren't next to each other, even though there is 4 of them.

```

Is there a way of doing this from the GNU+Linux command line? Maybe a regular expression using grep or sed? I've looked around the internet for grep regular expressions but they typically only check for how many of the same character are in a line, not if they are in sequence of each other. If there is anything more effective than using a regular expression (which can be automated and ran from a Linux-based distro), I am open to such suggestions.

I am currently using Manjaro Linux.

Thank you!