Grep and regex - why am I escaping curly braces?
问题 I'm deeply puzzled by the way grep seems to parse a regex: $ echo "@NS500287" | grep '^@NS500[0-9]{3}' #nothing $ echo "@NS500287" | grep '^@NS500[0-9]\{3\}' @NS500287 That can't be right. Why am I escaping curly brackets that are part of a "match the previous, N times" component (and not, say, the square brackets as well)? Shouldn't escaping be necessary only when I'm writing a regex that actually matches { and } as literal characters in the query string? More of a cri de coeur than anything