Crash on Anaconda Python if large number of pattern

Create issue
Issue #187 resolved
GuruCafe CafeGuru created an issue

Anaconda Python will be crashed if try to compile large number of pattern (more than 25154)

import regex

patt = '|'.join(["t%d" % i for i in range(0, 25154)])
regex.compile(patt)

Tested on :-

  • Python 2.7.11 :: Anaconda 2.5.0 (64-bit)
  • regex (2016.1.10)

Comments (5)

  1. Matthew Barnett repo owner

    A better (and faster) way to do that is to use named sets, e.g.:

    regex.compile(r'\L<choices>', choices=["t%d" % i for i in range(0, 25154)])
    

    Fixed in regex 2016.02.23.

  2. Log in to comment