Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 93267 invoked from network); 4 May 2007 09:58:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 May 2007 09:58:21 -0000 Received: (qmail 11191 invoked by uid 500); 4 May 2007 09:58:27 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 11182 invoked by uid 500); 4 May 2007 09:58:27 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list embperl@perl.apache.org Delivered-To: moderator for embperl@perl.apache.org Received: (qmail 87866 invoked by uid 99); 4 May 2007 07:52:17 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of yurenli@gmail.com designates 64.233.184.233 as permitted sender) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ieOJP6WlrVCGwerKOl5w35IiGev2wQl4R4QwOqtY6ifIPQtIIXqUMw7RPtfDur4dn1naBns3LpTYQ2TXkc5db/2XjEk3R1jwuUs7d+w2l5ea3oG5a5ZkeLL47QdZ8upoLj17ZZLYnSGoaaixLgWiIjNwVuCpAo6ZXBVb7fXGCtM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mzZVPzKuhliH48xNBhYsFr8Yec2lIuOVYzh2ZznAG95r20qa3NjJQ6zh0cU7HhhWFZbn0aJbWMIZ6C+7VBZ8ONT58YweJlgFxNjM1x4zESWRJNmrE/CQ0s4PjD0ijNk6Ovd5UpGfikYNPZ8q7Fbzeb5yMBhRqSVjDVCsP+q2BIM= Message-ID: Date: Fri, 4 May 2007 15:51:49 +0800 From: "Yuren Li" To: embperl@perl.apache.org Subject: About the regular expression problem MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have a problem when I use regular expression. The sample code: [- $_ = "One Two Three" -] [$ if(/(\S+) (\S+) (\S+)/) $] The words are: [+$1+], [+$2+], [+$3+] [$ endif $] The result should be "The words are: One, Two, Three," But I got the result "The words are: One, Two,." After trying, I found that I could just get the match variables $1 and $2, and the match veriables $3, $4 etc, could not be used in embperl. There is no problem about this in pure perl code such as $_ = "One Two Three"; if(/(\S+) (\S+) (\S+)/) { printf "The words are: $1, $2, $3"; } --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org For additional commands, e-mail: embperl-help@perl.apache.org