how to validate UTC format date

  javascript, regex, typescript

Can you help me how to write a regular expression for the below format?

"2020-02-07 15:45:25.763437 UTC+0000"

my rex should accept the below format also:
"2020-02-07 15:45:25"

I found how to find the "2020-02-07 15:45:25" but I don’t know how I can make the second part optional? can you help me to figure it out, please?


I am coding in typescript.

Source: Ask Javascript Questions