in reply to Strange regex-behaviour

Perl is not really thinking [3,] is {3,}

Let's step through the regex, and see why it matches.

/^ #Match at the beginning of the string ( #begin $1 [a-zA-Z_)[3,] #A character class .* #Any number of characters ? #Minimal match the .* ) #End $1 : #Match a colon ( #Begin $2 .* #Match until end of line )/x #End $2 and the match

Alright, the large character class will match one letter that is upper or lower case, and underscore, an open paren, a open bracket, a 3, or a comma. The open bracket does not confuse Perl into thinking we have a new character class (This can be tested by replacing 'Time' with '[ime'). This huge class matches the upper case 'T' in $line.

The dot star matches the 'ime' up until the colon. In this specific case, the minimal match construct doesn't do anything. (Test by deleting it). This all stores the word 'Time' in $1.

The colon is matched and not saved. So we begin saving after the colon, and we just match until the end of the line - that's '174657', which gets stored in $2.

Then we just print those things out. As for forming a regex which actually matches the format you want, I don't quite understand what that format is (your comment is unclear to me).

Hope this helps.

Cheers,
Erik