--============_-1188809197==_ma============
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
Post by Randal L. SchwartzEric> 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
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
--============_-1188809197==_ma============
Content-Type: text/enriched; charset="us-ascii"
At 2:08 PM -0700 6/5/02, Randal L. Schwartz wrote:
<excerpt>>>>>> "Eric" == Eric Goldhagen <<***@nomadlab.com> 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
<<***@stonehenge.com> <<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!
</excerpt>
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
<color><param>2222,2222,2222</param> one match is
</color>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
--============_-1188809197==_ma============--