title: Getting a regex trie to run faster?
body: <p>I have a 50mb regex trie that I'm using to split phrases apart.</p>
  
  <p>Here is the relevant code:</p>
  
  <pre><code>import io
  import re
  
  with io.open('REGEXES.rx.txt', encoding='latin-1') as myfile:
          regex = myfile.read()
  
  
  while True == True:
      Password = input("Enter a phrase to be split: ")
  
      Words = re.findall(regex, Password)
  
      print(Words)
  </code></pre>
  
  <p>Since the regex is so large, this takes forever! </p>
  
  <p>Here is the code I'm trying now, with re.compile(TempRegex):</p>
  
  <pre><code>import io
  import re
  
  with io.open('REGEXES.rx.txt', encoding='latin-1') as myfile:
          TempRegex = myfile.read()
  
  regex = re.compile(TempRegex)
  
  while True == True:
      Password = input("Enter a phrase to be split: ")
  
      Words = re.findall(regex, Password)
  
      print(Words)
  </code></pre>
  
  <p>What I'm trying to do is I'm trying to check to see if an entered phrase is a combination of names. For example, the phrase "johnsmith123" to return ['john', 'smith', '123']. The regex file was created by a tool from a word list of every first and last name from Facebook. I want to see if an entered phrase is a combination of words from that wordlist essentially ... If johns and mith are names in the list, then I would want "johnsmith123" to return ['john', 'smith', '123', 'johns', 'mith']. </p>