From owner-freebsd-questions Tue Oct 23 12:53:38 2001 Delivered-To: freebsd-questions@freebsd.org Received: from smtp006pub.verizon.net (smtp006pub.verizon.net [206.46.170.185]) by hub.freebsd.org (Postfix) with ESMTP id DBD4837B403 for ; Tue, 23 Oct 2001 12:53:34 -0700 (PDT) Received: from verizon.net (lsanca1-ar14-096-036.lsanca1.dsl.gtei.net [4.41.96.36]) by smtp006pub.verizon.net with ESMTP for ; id f9NJrOv24015 Tue, 23 Oct 2001 14:53:29 -0500 (CDT) Message-ID: <3BD5CA67.F591A343@verizon.net> Date: Tue, 23 Oct 2001 12:52:07 -0700 From: Shill X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: regex(3), re_format(7) and shortest match References: <3BD5A7F4.748285AA@verizon.net> <20011023194940.A8947@roman.mobil.cz> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >> Say I have the string: >> "yo hiphop fun" >> >> Can anyone tell me how to achieve the shortest match? >> >> i.e. the first call to regexec() would return "" >> and the second would return "". > Try this: () What if '<' '/' 'a' '>' are all valid characters inside ""? i.e. if I have the string "yo hiphop" a call to regexec() should return " ". If I use the () regex, it would just return REG_NOMATCH. Shill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message