From owner-freebsd-questions Mon Oct 2 11: 1:37 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dh198-236.dhcp.sunysb.edu (dh198-236.dhcp.sunysb.edu [129.49.198.236]) by hub.freebsd.org (Postfix) with ESMTP id 2EE1837B66D for ; Mon, 2 Oct 2000 11:01:34 -0700 (PDT) Received: (from chris@localhost) by dh198-236.dhcp.sunysb.edu (8.9.3/8.9.3) id OAA84127; Mon, 2 Oct 2000 14:01:11 -0400 (EDT) (envelope-from chris) From: Christopher Rued MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14808.52583.347797.384055@chris.xsb.com> Date: Mon, 2 Oct 2000 14:01:11 -0400 (EDT) To: freebsd-questions@freebsd.org Subject: Perl question X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I realize that this is not really a FreeBSD question, but I like this mailing list and the answers that are sent to it :). My question is: How do I have perl return me the first and only the first match to a regular expression? I know that I can return /all/ matches to an array, and get the first one, but I only want to have it evaluate as far as the first match and then stop. For example, given the string xayxbyxcy and the regular expression x.y, I want it to return to me only xay and not evaluate any further. Thanks in advance. -- -Chris Rued To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message