I have below commands for extracting only the lines that will all consecutive duplicates two or more times I want to edit these
perl commands to exclude the first and the second character from the end of a line from being duplicated.
perl -lne 'print if /^((.)\2+(?!\2))+$/' sed -Ee '/^((.)\2+)+$/!d' input.txt
I want to print only the lines with all consecutively repeated characters except the last one or the last two characters in the same line. Non consecutively repeating characters are allowed, but only if 1st or 2nd from the end of a line of my big text file.
For example input file contains:
111224 447758 1122323 15225168 55226565
The output file should contain:
111224 (only last character is not consecutively repeated) 447758 (only the last two characters are not consecutively repeated)