consttimeIsValid=/^\d{2}:\d{2}$/.test('12:05');// Or it is better: const timeIsValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/;console.log(timeIsValid);//true
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Discussion on: Javascript regex part 4 searching for patterns in specific positions
For further actions, you may consider blocking this person and/or reporting abuse