[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


Doesn't

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

Say:
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
FROM


$_ = "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?

Jay






More information about the Chicago-talk mailing list