In multi-line regular expressions, \A corresponds to the beginning of a line (a \Z represents the end of a line, and ^ / $ corresponds to the beginning / end of a line or the beginning / end of a line). In single-line options, you simply use ^ and $ to start and end the line / line, as there is no difference.
To is a literal, \: is escaped :
\s means a space, and + means one or more of the previous "characters" (space in this case).
() is a capture group, that is, everything here will be stored in a βregisterβ that you can use. Therefore, it is the meat to be extracted.
.* just means any newline character . , zero or more times * .
So, what this regular expression will do, you need to process a string like:
To: paxdiablo Re: you are so cool!
and return the text paxdiablo .
Regarding how to learn how to do it yourself, the Perl regex tutorial (a) is a good start, and then practice, practice, practice :-)
(a) In fact, you did not specify which version of the regular expression you are using, but the most modern ones are very similar to Perl. If you can find a specific tutorial for your particular fragrance, this will obviously be better.