In article <mgcbkc$lcs$
3...@aspen.stu.neva.ru>,
Hongyi Zhao <
hongy...@gmail.com> wrote:
> Hi all,
>
> I want to use awk regexps to match the file size and the date-time
> written in following form:
>
> 1,370 2015/01/10 18:21:28
>
> I've tried some forms but all of them are cumbersome and I've digged into
> the google for it and find also some cumbersome forms.
>
> So, are there some concise awk regexps for matching the things like this:
> 1,370 2015/01/10 18:21:28?
>
Something like this?
^[0-9,]+ [0-9]{4}/[0-9]{2}/[0-9]{2} ([0-9]{2}:){2}[0-9]{2}$
Unfortunately, awk doesn't use \d for digits, so you have to use the
more verbose [0-9] throughout.
--
Barry Margolin,
bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***