egrep doesn’t recognize \d shorthand for digit character class, so you need to use e.g. [0-9].
Moreover, while it’s not absolutely necessary in this case, it’s good habit to quote the regex to prevent misinterpretation by the shell. Thus, something like this should work:
egrep '[0-9]{7}-[0-9]{10}' file
See also
egrepmini tutorial
References
- regular-expressions.info/Flavor comparison
- Flavor note for GNU
grep,ed,sed,egrep,awk,emacs- Lists the differences between
grepvsegrepvs other regex flavors
- Lists the differences between
- Flavor note for GNU