php-proxy
php-proxy copied to clipboard
Improve parsing of href=
This malformed href= is not correctly parsed:
<a href=/1233fffdc0d1537bb0046c316ca0385c967a906f>
On Glype it is parsed correctly using this regex:
#(?><[A-Z0-9]{1,15})(?>\s+[^>\s]+)*?\s*(?>(href|src|background|poster)\s*=(?!\\\\)\s*)(?>([\\\'"])?)((?(2)(?(?<=")[^"]{1,2048}|[^\\\']{1,2048})|[^ >]{1,2048}))(?(2)\\2|)#i
Tested here: http://www.phpliveregex.com/p/j63