Grouping of python regular expressions

the code is as follows:

re.compile("^(\d{1,2}: )(.*?)(:)")

what is the logic and result of this code matching? Thank you.


should be: begins with one to two digits (0-9) followed by a colon (:) and a space (), matches any character (excluding newline characters) in non-greedy mode, and ends with a colon

< hr >

you can use this online tool to test your regularity, and it will also give you a detailed explanation

.
Menu