On Fri, Apr 11, 2025 at 11:46:08PM +0000, dvalin--- via GNU roff typesetting 
system discussion wrote:
> On 11.04.25 06:24, G. Branden Robinson wrote:
> 
> > At 2025-03-30T22:23:58+0000, Lennart Jablonka wrote:
> 
> > > It’s implementation-defined whether \+ behaves like literal + or like
> 
> > > \{1,\}.  (The same applies to \? and \|; I didn’t find uses of those.)
> 
> > > As it happens, OpenBSD treats it as literal +.
> 
> > >
> 
> > > Found it through a failure of html-device-smoke-test.sh.
> 
> >
> 
> > Thanks!  Expect this in my next push.
> 
> The difference between theory and practice is much greater in practice than 
> it is in theory, and a complete switch to modern EREs would doubtless be a 
> major burden, so I'm not sure how helpful it is to remind that moving away 
> from obsolete¹ BREs would eliminate the above problem, and additionally make 
> all REs more readable by eliminating the obfuscating backslash storm which 
> afflicts
> 
> BREs. E.g. all the backslashes in the above example would vanish into
> 
> the dustbin of superfluity, leaving only the stuff which does stuff.
> 
> It's just a thought - less is more, I figure, and wading through a cloud
> 
> of characters which don't do anything just makes your job harder.
> 
> ¹ See "man 7 regex".
> 
> Erik


Note that since POSIX EREs, strictly speaking, don't support
back-references, just eliminating a few of the backslashes might not
always be enough.  At least not in the most general case.

Andreas

-- 
Matti Andreas Kähäri
Uppsala, Sweden

.

Reply via email to