On Sun, 16 May 2021 at 10:38, Vikram S <[email protected]> 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'
          ) }}"

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwONpVH%3D5aBd-3j%2BGqh7tu4hmDjHfMQH%3DR1fKt9D%2B4c7vg%40mail.gmail.com.

Reply via email to