in reply to Applying a regular expression to a string
What you want is to select everything before the first \s, and assign that to $message_id; use a match, not a substitution, to do that:
(Note the parentheses around $message_id that make it a list assignment; you need to do the($message_id) = $message =~ /^(\S*)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Applying a regular expression to a string
by mw (Sexton) on Apr 07, 2005 at 07:50 UTC |