That prints nothing because there's no /\bXYZ:\b/ in that string! Give it a start/end point that actually occurs, and you'll see you're on the right track.$text = "xcystartsdhjsXYZ:joeblow@mail.cpEwrendrwerwep"; if ($text =~ /\bXYZ:\b(.*?)\b@mail.cp\b/) { $result = $1; # do something with results print $result, $1; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: Gimmie the Stuff Between Two Keywords
by merlyn
in thread Gimmie the Stuff Between Two Keywords
by mumbles
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |