What does this code do?

$1 and $2 are variables that hold the captured information in the regular expression on the previous line: mail.encoded =~ /user\[identifier\]=(.*?)&key=(.*?)"/ Translation: All the characters between user[identifier]= and the first occurrence of &key= are captured into $1, and all the characters after &key= until the first occurrence of " are captured into $2. If that barely made sense to you, I'd recommend reading a regular expression tutorial (like on regular-expressions.info). You will likely use them often if you plan to do any significant amount of parsing in just about any language (esp. Ruby, Perl, Python, JavaScript, PHP, and so on).

HTH, Matt