Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Thanks you, so far. But: Am I right saying that without the -E option grep wouldn't do much? This would explain quite a lot, for example why I wasted so much time looking for where I was wrong! Commented Apr 2, 2013 at 21:02
  • Without the -E option you can do the same in this case, but you would need to escape more and there is no + operator.. I'll post examples too. Commented Apr 3, 2013 at 5:56
  • A small correction: grep -E '(.)\1{2}' does not exactly "Find matches with exactly 3 matches". While it will match exactly three identical characters, they may be embedded in a longer repeated string; e.g., it will match in the 5-symbol string AAAAA. (And if there are 6 or more consecutive symbols, it will match more than once). Commented May 11, 2016 at 13:48
  • Yes you are absolutely right, that does not work as intended, in fact it is not possible like that.. Commented May 13, 2016 at 7:02