lundi 29 décembre 2014

Grep lines that cotain "1111-11-11" or "2382-21-20". (Any Numbers)


I have tried to do this and I came up with this



grep -E '\<[0-9]{4}"-"[0-9]{2}"-"[0-9]{2}\>'


It doesn't work and the reason for that is the "-" and multiple grep things, so I tried dividing them with a pipe like this



grep -E '\<[0-9]{4}-|[0-9]{2}-|[0-9]{2}\>'


But it still matches lines like 4444, or similar. Anyone know how to achieve what I want?



Aucun commentaire:

Enregistrer un commentaire