On Sun, 16 May 2021 at 10:38, Vikram S <
vikrams...@gmail.com> wrote:
>
> Hi,
>
> I suspect your script may show ewverything in 'sh clock' output and not the partial output i wanted. Thanks for the links, will check them.
You expect this based on? First check.
If you must parse dates like that, it requires more data. Is the first
line ('Switch#sh clock') also part of the output? Let's assume so.
And is the month abbreviated or not? From just 'May' we can't tell.
Assuming it is, this works, in this century:
"{{ out | regex_replace(
'(?s).*(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s+(\\d{1,2})\\s+(20\\d\\d)$',
'\\2 \\3 \\4'
) }}"