Don't use the regex module #1843

merged 1 commit into from Mar 12, 2014


None yet

3 participants

twpayne commented Mar 11, 2014

This PR removes the dependency on the Python regex module, which has caused problems for many people.

A little bit of history:

Regular expressions are a key part of the the code that checks for missing or unnecessary goog.requires. The regular expressions are generated automatically and make significant use of nested subgroups for efficiency. The number of subgroups can grow quite large, and is related to the structure of the goog.require dependency graph.

Unfortunately, Python's default re module has a completely arbitrary hard-coded limit on the maximum number of subgroups, and the automatically generated regular expressions hit this limit. Python's replacement regular expression library, regex, does not have this arbitrary hard-coded limit, and so works.

However, it seems that current goog.require dependency graph means that the automatically generated regular expressions have stopped exceeded the hard-coded limits of re.

This PR switches back from regex to re.

fredj commented Mar 12, 2014




@twpayne twpayne merged commit 5c6eb85 into openlayers:master Mar 12, 2014

1 check passed

Details default The Travis CI build passed
@twpayne twpayne deleted the twpayne:no-regex branch Mar 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment