title: Referencing previous group possible within the same regex?
body: <p>I am trying to perform a regex in Python. I want to match on a file path that does not have a domain extension and additionally, I only want to get those file paths that have 20 characters max after the last '\' of the file path. For example, given the data:</p>
  
  <pre><code>c:\users\docs\cmd.exe
  c:\users\docs\files\ewyrkfdisadfasdfaffsfdasfsafsdf
  c:\users\docs\files\target
  </code></pre>
  
  <p>I would want to match on 'target', and not the other two lines. It should be noted that in my current situation, <strong>using the re module or python operations is not an option, as this regex is fed into the program (which uses re.match() ), so I have do to this within a regex string.</strong> </p>
  
  <p>I have two regexes:</p>
  
  <pre><code>^([^.]+)$ will match the the last 2 lines
  
  ([^\\]{,20}$) will match 'cmd.exe' and 'target'
  </code></pre>
  
  <p>How can I combine these two into one regex? I tried backreferencing (?P=, etc), but couldn't get it to work. Is this even possible?</p>