[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Regular expressions in Subversion

From: Hyrum K Wright <hyrum_at_hyrumwright.org>
Date: Wed, 17 Oct 2012 12:20:20 -0400

There are several places where regular expressions would be useful in
Subversion. Off hand, the new log --search feature and svn:ignore
properties feel like they'd be use candidates for regexs, and they
could probably also apply to authz rules eventually. I'm sure there
are more.

Historically, the argument against using regexes in Subversion was
that they would be a potential DoS target, or could lead to unexpected
performance problems. However, I recently ran across a new regex
engine, RE2, which claims to have linear time complexity in the size
of the input with the ability to also limit memory consumption[1].
These come at the expenses of a couple of less-used regex features,
and it feels like it'd be a good fit for Subversion.

There are a few downsides:
 * RE2 is written in C++; we'd need a C wrapper to use it within Subversion.
 * RE2 packages don't exist for a number of platforms, though we might
be able to embedded it in Subversion.
 * RE2 doesn't claim to compile on Windows. :)

Anyway, I was just wondering what folks feelings were about this
possibility, and whether it's finally time to start thinking about
proper regex support within Subversion.

-Hyrum

[1] https://code.google.com/p/re2/
Received on 2012-10-17 18:20:55 CEST

This is an archived mail posted to the Subversion Dev mailing list.