[pcre-dev] Syntax compatibility among multiple copies of a p…

Top Page
Delete this message
Author: Zack Weinberg
Date:  
To: pcre-dev
Subject: [pcre-dev] Syntax compatibility among multiple copies of a program, using different versions of PCRE internally
I'm working on the Monotone distributed version control system. We
use PCRE for regular expressions in a number of places, some of which
are not only part of the user interface, but part of the distributed
state of a given project. Thus, I'm worried about syntax
compatibility. The problem scenario goes like this: Alice and Bob
both have the same version of Monotone, but Alice compiled hers with
PCRE 7.6 and Bob compiled his with PCRE 7.8. In between 7.6 and 7.8,
a nifty new regex syntax feature was added. Bob decides to use this
nifty feature in the .mtn-ignore file. The next time Alice updates
her local copy of the project from Bob, she gets the .mtn-ignore file
with the nifty feature that her copy of Monotone doesn't understand,
and things break.

My questions for you are:

1) How realistic is the above worry? It doesn't *seem* like the regex
syntax is changing that much between PCRE minor releases, but I don't
know what's planned for the next few releases.

2) Would it be possible to add defensive measures to the API to
prevent the problem? For instance, could we have a new pcre_compile()
variant that took a version number as an additional argument, and did
not accept regex features added after that version, even if the
library supported them?

Thanks,
zw