# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/^<tr.*?>(?:<td>.*?<\\/td>){2}<td>(.*?)<\\/td><td>.*?<\\/td><td>(.*?)<\\/td>.*?<a href=".*?_(.*?)_(.*?)\.html.*$/$2;$1;$3\\/$4/gm;t' <<< "<tr><td><small>1</small></td><td>Kalisz</td><td>62-800</td><td>Poland</td><td>Greater Poland</td><td>Kalisz</td><td>Kalisz<tr><td></td><td colspan=6> <a href=\"/maps/browse_51.75_18.087.html\" rel=\"nofollow\"><small>51.75/18.087</small></a></td></tr>
<tr class=\"odd\"><td><small>2</small></td><td>Piotrków Trybunalski</td><td>97-300</td><td>Poland</td><td>Łódź Voivodeship</td><td>Piotrków Trybunalski</td><td>Piotrków Trybunalski<tr class=\"odd\"><td></td><td colspan=6> <a href=\"/maps/browse_51.411_19.689.html\" rel=\"nofollow\"><small>51.411/19.689</small></a></td></tr>
<tr><td><small>3</small></td><td>Toruń</td><td>87-100</td><td>Poland</td><td>Kujawsko-Pomorskie</td><td>Toruń</td><td>Toruń<tr><td></td><td colspan=6> <a href=\"/maps/browse_53.021_18.623.html\" rel=\"nofollow\"><small>53.021/18.623</small></a></td></tr>"
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html