http://www.perlmonks.org?node_id=444630


in reply to Applying a regular expression to a string

Try something like:
my $message_id = $1 if $message =~ m/([\w\d]+)\s+.*/;

If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
That way everyone learns.