At 2:08 PM -0700 6/5/02, Randal L. Schwartz wrote:
>>>>> "Eric" == Eric Goldhagen <[EMAIL PROTECTED]> writes:

Eric> Randal,
Eric> thanks, but it still does not work for me.

Eric> I tried
Eric> [% matches = fullstory.match("(\\w+ $s_word \\w+)") %]

Eric> and

Eric> [% matches = fullstory.match("(\\w+$s_word\\w+)") %]

Eric> any other ideas?

$ tpage
[%
fullstory = "kermit the frog";
s_word = "the";
matches = fullstory.match("(\\w+ $s_word \\w+)");
FOREACH m = matches;
"one match is <"; m; ">\n";
END;
%]
^D
one match is <kermit the frog>
$

Looks good to me. You have only one paren set, so you get
back only one match.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



OK

Something must be wrong on my system.

If I do this via tpage I get the right result.

But if I put the code into a template and hit the page, I just get
one match is

and nothing else.

I will move the code over to another machine and try again.

Thanks for the help.

--Eric
------------
ABC No Rio http://www.abcnorio.org
The Interactivist Network http://www.interactivist.net
Autonomedia http://www.autonomedia.org
Nomad Media Lab http://www.nomadlab.com

Reply via email to