Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Nov 2025 12:01:30 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 291172] regexp.h routines behave differently for my program and in the base grep
Message-ID:  <bug-291172-227-8cuJBjGhhW@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-291172-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291172

--- Comment #2 from Gleb Popov <arrowd@FreeBSD.org> ---
(In reply to Konstantin Belousov from comment #1)
> 1. '+' must not be escaped by backslash, it becomes ordinary character to match
> 2. '+' only works as metasymbol for extended regexps, so you need REG_EXTENDED

According to
https://en.wikibooks.org/wiki/Regular_Expressions/POSIX-Extended_Regular_Expressions
when working in REG_BASIC mode one should use '\+' and it works just like '+'
in REG_EXTENDED.

> BTW, why did you specified literal 4 as flag for regexec?

It was a remnant of my experimentation when comparing to grep. grep passes 4 as
eflags when calling regexec. Let me reupload the test program.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-291172-227-8cuJBjGhhW>