in reply to Strange regex-behaviour

You're basically matching by luck. I believe Perl is interpreting the regex as follows:
/^([character-class].*?):(.*)/ #where character-class == a-zA-Z_)[3,

That is, the '[3,' is getting interpreted as part of the character class with its missing close bracket, not as some kind of modifier on the class.

Of course this isn't as strict a matching pattern as you were expecting!