[Chicago-talk] Need help on a parsing that used to work

Jay Strauss me at heyjay.com
Mon Nov 24 23:11:58 CST 2003


> /^([^\s]+):(.*)$/

starting at the beginning of the string, capture one or more non-whitespace
followed by a colon.

which doesn't match anything (because of the whitespace between RCPT and

$_ = "RCPT FROM: bernie at mesatech.com";
$_ =~ m/^(.*):\s+(.*)$/;
print $1,"\n";
print $2,"\n";

works but is a little reckless.  Isn't there some module with a bunch of
predefined regexen for parsing mail?


More information about the Chicago-talk mailing list