How to make a regular expression to take me href, src, css links python
<p>I need to take the links src, css, href, a html page and save them to a text file.</p>

<p>I need to do with regular expressions (regex).
Thanks!</p>

<pre><code>import re

p = re.compile(ur'.*(src|css|href|a html).*')

test_str1 = '&lt;a html&gt;'
test_str2 = 'String without any tags'

if re.match(p, test_str1) is not None:
    print test_str1

if re.match(p, test_str2) is not None:
    print test_str2
&gt;&gt; &lt;a html&gt;
</code></pre>

<p>Here is a solution for python 2.7, 
I assume that you understand the regex part but if not here is a good tutorial <a href="https://regex101.com/" rel="nofollow">site</a> that you can use to test your regex.</p>

python