in reply to Regex substitution problem
$to_email =~ s/.+To:\s(.*?)xxx/\1/;
will do what you want. The * is greedy which means it will take as much as it can. The '?' changes the * to a non-greedy version
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex substitution problem
by mahira (Acolyte) on Feb 14, 2009 at 13:07 UTC |