Question: I'm trying to learn regex with Python and write a script that finds a part of a web page.
I get the page with `curl`, but I don't know how to match this expression:

```none
"is available from 9 known sites(<a href="#verified">verified</a> 1 hour and 24 minutes ago)"

```

this is the URL: <http://curl.haxx.se/latest.cgi?curl=tar.gz>

Is there someone who can help me?

Answer: 
If the generic string you want to find looks like:

```
s = 'is available from 9 known sites (<a href="#verified">verified</a> 1 hour and 25 minutes ago)'

```

This regular expression will find it:

```
re.search(r'is available from \d+ known sites \([^\>]*>[^>]*> \d+ hours? and \d+ minutes? ago\)', s)

```

You can play around with regular expressions on [regex101.com](http://regex101.com/r/xE0zQ7).
First, view the source of the webpage. With a quick find, we can see where the string you're looking for is:

```
<h2>curl-7.36.0.tar.gz</h2>
<b>What:</b> Generic source tar, gzip
<br><b>SHA-1:</b> <tt>35e9fb187c7512ee0206aad8ffeb4cdbf3ed80b2</tt>
<br><b>MD5:</b> <tt>643a7030b27449e76413d501d4b8eb57</tt>
<br><b>Size:</b> 3564934 bytes
<br><b>Version:</b> 7.36.0
<br><b>GPG signature:</b> <a href="download/curl-7.36.0.tar.gz.asc">curl-   7.36.0.tar.gz.asc</a><br><br>Download this file with a <span class="metalink"><a href="metalink.cgi?curl=tar.gz" type="application/metalink+xml"><img src="/pix/metalink.png" border="0" alt="">metalink</a></span>.<br>
<p><b><tt>curl-7.36.0.tar.gz</tt></b> is available from
 9 known sites (<a href="#verified">verified</a> 1 hour and 16 minutes ago)

```

I assume that `"Is available from " x " known sites"` will not change. Therefore, you can find the number of known sites like this:

```
import re
x = 'is available from 9 known sites (<a href="#verified">verified</a> 1 hour and 16 minutes ago)'
i = re.search('is available from [0-9]* known sites',x)

```

`i` stores your match object, to access the string, simply use `i.group(0)`

You can generalize the regular expression to get the rest of the sentence you need. To find more regular expression special characters, check out the Python re documentation: <https://docs.python.org/2/library/re.html>