From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124974 invoked by alias); 4 Dec 2018 14:54:48 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 124958 invoked by uid 89); 4 Dec 2018 14:54:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=tired, H*Ad:U*libc-help X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 04 Dec 2018 14:54:47 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16C6230832C5; Tue, 4 Dec 2018 14:54:46 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-116-250.ams2.redhat.com [10.36.116.250]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 33F1B60FE6; Tue, 4 Dec 2018 14:54:45 +0000 (UTC) From: Florian Weimer To: Anand Akhare Cc: libc-help@sourceware.org Subject: Re: regexec pattern matching References: Date: Tue, 04 Dec 2018 14:54:00 -0000 In-Reply-To: (Anand Akhare's message of "Fri, 2 Nov 2018 14:29:00 +0530") Message-ID: <87va49tk98.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00001.txt.bz2 * Anand Akhare: > Hello, > regexec matching pattern against buffer throughout complete length > and skips for those that doesn't match until match is found. > Is it possible to get match for first character and if match fails, it > returns fail rather than going forward to next characters. > In summary, only start of buffer should b considered for match. I think glibc's non-POSIX matching interfaces (re_search etc.) support this via the range argument, but I have not tired this. Thanks, Florian