Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Don't use the regex module #1843

merged 1 commit into from

3 participants


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.





@twpayne twpayne merged commit 5c6eb85 into openlayers:master

1 check passed

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

    Don't use the regex module

    twpayne authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 2 deletions.
  1. +1 −1 
  2. +0 −1  requirements.txt
2 
@@ -5,7 +5,7 @@
import json
import os
import glob
-import regex as re
+import re
import shutil
import sys
1  requirements.txt
@@ -1,3 +1,2 @@
Something went wrong with that request. Please try again.