[Sussex] [OT kinda] PHP and regex

John Crowhurst fyremoon at fyremoon.net
Tue Nov 26 00:51:01 UTC 2002


> "^<a href[\"\'A-Za-z0-9_+\.+\"\']>[A-Za-z0-9+\.A-Za-z0-9+]</a>"

I thought I'd try to implement this match in perl, so I cam up with this:
/.*<a href=\"(.+\">.+)<\/a>/$1/

Which will match everything, but will return "> as well, which I'm not
regex skilled to remove in one hit, so a simple s/\">//g would remove
afterwards.

--
John






More information about the Sussex mailing list