This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Regex: Will re_nsub be zero if REG_NOSUB was passed to regcomp?
- From: Mark Brown <ms_brown at sbcglobal dot net>
- To: libc-help at sourceware dot org
- Date: Mon, 11 Aug 2014 14:34:41 -0500
- Subject: Re: Regex: Will re_nsub be zero if REG_NOSUB was passed to regcomp?
- Authentication-results: sourceware.org; auth=none
- References: <trinity-e46f9804-40e8-4085-b8e8-ba31cf199ec9-1407377687772 at 3capp-mailcom-lxa15> <trinity-94314874-b377-4952-9bd6-fc63a0b634f9-1407515438158 at 3capp-mailcom-lxa08>
On 08/08/2014 11:30 AM, frank ernest wrote:
> Regex: Will re_nsub be zero if REG_NOSUB was passed to regcomp?
>From a programming portability perspective, the value of re_nsub in this
case could be either zero or the number of subexpressions, or anything
in between; you've told regcomp you don't care about anything but
pass/fail. You should not be checking this value and expecting a
consistent or portable result.
Is there a context in which having this be determinate is of value?
--
Mark Brown
ms_brown@sbcglobal.net