How does grep match the specified two digits in liunx

newcomer linux, would like to ask how to use grep to match a specified two-digit number.
for example, the original file has various times:

clipboard.png

I now want to specify a match between 18:00 and 22:00. How do I use grep?


grep -Pe '\d{4}-\d{2}-\d{2},(18|19|20|21|22):.*'  <>
< H2 > reference < / H2 >
  1. grep help documentation man grep
  2. https://regexr.com/
Menu