Python: regular expressions in url
<p>I have some url like</p>

<pre><code>https://www.avito.ru/chelyabinsk/avtomobili/audi_a4_2014_818414044
</code></pre>

<p>And I need to get pattern from this. I know, that * is the symbol, that can replace any symbol, but when I try <code>https://www.avito.ru/*/avtomobili</code> it doesn't open this url. 
How can I fix that?</p>

<p>From your example, to match </p>

<pre><code>https://www.avito.ru/chelyabinsk/avtomobili/audi_a4_2014_818414044
</code></pre>

<p>you would need to have a regex of</p>

<pre><code>https://www\.avito\.ru/.*?/avtomobili
</code></pre>

<p>in <code>https://www.avito.ru/XXXXXX/avtomobili</code> : <code>XXXXXX</code> can be anything</p>

<p><code>.*?</code> means match anything (as little as possible) until you get to /avtomobili</p>

<p>You also need to escape any DOT like this <code>\.</code></p>

python regex