Informatics1-2017/HW2
A MathWikiből
How to
Use the webpage we used on the practical: https://regex101.com/#python
All you need to send is the regex (that you wrote in the regular expression box on the website).
Regex links (3 points)
Write a regular expression that finds links in an html code. We can assume that links:
- start with http://
- apart from alphanumeric characters only contain the following characters:
- / (per),
- . (dot),
- ~ (tilde).
For example, in the following code it only finds the 4 links:
<div> <div id="header_col2"> <a href="index_en.xhtml" title="English version"> <img src="eng.jpg" alt="English" height="25" width="48"/> </a> </div> </div> <div id="clear"> <hr/> <h2> Some links </h2> <p> <a href="http://www.math.bme.hu/algebra">Department of Algebra</a><br/> <a href="http://www.math.bme.hu/">Matematics Institude</a><br/> <a href="http://www.bme.hu/">BME</a> <br/> <a href="http://www.bme.hu/~kk0v4cs">Something else</a> <br/> </p> </div>
Found results: