title: In Ansible, how to use a variable inside a variable definition that uses filters
body: <p>I want to extract a few regex matches out of a URL. The only way I could do this was following:</p>
  
  <pre><code>  - name: Set regex pattern for github URL
      set_fact: pattern="^(git\@github\.com\:|https?\:\/\/github.com\/)(.*)\/([^\.]+)(\.git)?$"
  
    - name: Extract organization name
      set_fact: project_repo="{{ deploy_fork | regex_replace( "^(git\@github\.com\:|https?\:\/\/github.com\/)(.*)\/([^\.]+)(\.git)?$", "\\3" ) }}"
      when: deploy_fork | match( "{{ pattern }}" )
  </code></pre>
  
  <p>With this approach, I'm able to reuse the variable <code>pattern</code> in the <code>match</code> filter, but not on the <code>set_fact</code> line where I assign the extracted text to another variable.
  Is there any way to reuse the variable in <code>set_fact</code> that uses <code>filter(s)</code> ?</p>