3
I have the following regular expression:
([:digit:]{4})-([:digit:]{1,2})-([:digit:]{1,2})
It should get dates in this format:
2010-12-19
And I am using it on filenames that look like this:
2010-12-19-xxx-xxx-xxx.markdown
And, when I use it with grep
like this:
echo $POST | grep -oE "([:digit:]{4})-([:digit:]{1,2})-([:digit:]{1,2})" # $POST is the filename
It doesn't work, I just get emptiness.
1Actually, you don't need egrep if you have the
-E
option. From the grep man page: "Egrep is the same as grep -E" – Wuffers – 2010-12-20T01:45:26.493