[Sussex] [OT kinda] PHP and regex

Macdonald-Wallace, Matthew J s0209208 at glos.ac.uk
Mon Nov 25 19:09:00 UTC 2002


All,

I'm trying to get certain parts of a page to display on another without
using an include(..).

I'm doing this purely as an exercise to see if its possible, what I want to
do is strip the URLS from a page and list them like so:

Link 1 = <a href="http....">Text of link 1</a>
Link 2 = <a href="http....">Text of link 2</a>
Link 3 = <a href="http....">Text of link 3</a>
...

Would I be correct in thinking that the regular expression would be along
the lines of:

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

Coz this isn't working! :o)

Help!

TIA,

Matt




More information about the Sussex mailing list