A couple of handlers...
David Bovill
david at openpartnership.net
Thu Jan 11 08:14:51 EST 2007
As I am not much good at regular expressions I thought I would share my
ignorance with others :) Here is the best I can do with regard to extracting
links from htmltext in fields - they only work on a single line and they do
not find links with variable whitespace as you may get in html web pages.
on html_DeconstructNameLink nextHtmlLine, @someText, @someLink
-- <a name="/Users/david/Movies/crossingTheBridge.mp4">Crossing The
Bridge</a>
put "<a name=" & quote & "([^>]*)" & quote & ">([^<]*)</a>" into someReg
return matchText(nextHtmlLine, someReg, someLink, someText)
end html_DeconstructNameLink
on html_DeconstructRefLink nextHtmlLine, @someText, @someLink
-- <a href="/Users/david/Movies/crossingTheBridge.mp4">Crossing The
Bridge</a>
put "<a href=" & quote & "([^>]*)" & quote & ">([^<]*)</a>" into someReg
return matchText(nextHtmlLine, someReg, someLink, someText)
end html_DeconstructRefLink
Is there a better way?
More information about the use-livecode
mailing list