Using Regex I would like to get time alone from the below text string. The below one is printing in a single line. My objective is use less .js line to achieve this. Any advise would be really helpful.
let myArr = [];
let text = "12:30 am01:00 am10:00 am10:15 am";
finalTime = text.replace(/[^0-9: ]/g, '');
console.log(finalTime);
I am expecting Array values should display as below for me to choose easily or may be a json object will do
let myArr = ["12:30", "01:00", "10:00", "10:15"]

09:00 pm? Do you just need09:00or21:00instead?