• + 1 comment
    grep "\([0-9]\) \?\1"
    

    On my system (Ubuntu 20.04 with GNU grep 3.4 the following simpler command works as well: grep -E "([0-9]) ?\1" I don't understand why it doesn't work here.