Sort by

recency

|

87 Discussions

|

  • + 0 comments
     grep '\(\d\)\s*\1'   
    

    there could be zero or one space between the repeated numbers...

  • + 0 comments

    I don't know why 9999 5628 9201 1232 shouldn't be in the output. I guess the test has some part wrong.

  • + 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.

  • + 0 comments
    grep "\(\d\)\s?\1"
    
  • + 0 comments

    grep '\([0-9]\)[[:space:]]*\1'