I have the following expression which fetches all links of a website. /<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>/siU PHP: At the moment it can detect links if href is encapsulated by "" or nothing. However I want it to also work for ''. How can I do that?