Menü schliessen
Created: December 3rd 2013
Last updated: May 1st 2020
Categories: Common Web Development
Author: Marcus Fleuti

Regex to find an URL (containing umlaute) within an HTML A-HREF tag

Tags:  a href,  german,  regex,  regexlib.com,  umlaute,  url
Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

This regex will find an URL within an HTML A HREF tag. The basic regex we found on regexlib.com but we had to slightly modify it to allow German umlaute as well:

(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:\/~\+#äöüÄÖÜ]*[\w\-\@?^=%&\/~\+#])?