title: Why does a joined list have to be inside a non-capturing group for the regex to be able to interpret it?
body: <p>So I'm trying to build a regex that searches for an occurrence of digits followed by a white space following by one of many possible key words (represented by <code>test_cases</code> in this case). </p>
  
  <p>The first regex below does that successfully however I'm confused as to why it works. My understanding of capturing groups is that they allow you to put quantifiers on the group and also assist in specifying what data is returned. Why does this example need to be in the non-capturing group for it to be processed correctly?</p>
  
  <pre><code>test_string = "251 to 300 Vitality"
  test_cases = ["Damage", "Pods", "Chance", "Vitality"]
  
  print(re.findall(r'\d+\s(?:{})$'.format('|'.join(test_cases)), test_string)) # works
  print(re.findall(r'\d+\s({})$'.format('|'.join(test_cases)), test_string)) # doesn't work
  print(re.findall(r'\d+\s{}$'.format('|'.join(test_cases)), test_string)) # doesn't work
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>['300 Vitality']                                                                                                                      
  ['Vitality']                                                                                                                          
  ['Vitality'] 
  </code></pre>