Getting text within tags

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Getting text within tags

Post by Andycal » Fri Feb 15, 2008 9:54 pm

Just trying to find uses for Runrev (I'm a hobbyist at best!) and I thought it might be useful to be able to grab the text between two tags like :

<p>Hello, this is the text</p>

This would be useful for grabbing information from websites. Anyone got any examples or pointers?

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Fri Feb 15, 2008 10:15 pm

Right, very quickly done some research and I found the following regex that does what I'm after apparently:

Code: Select all

<TAG\b[^>]*>(.*?)</TAG>
I tried this in the 'matchtext' function, but it just spat out 'false'.

Post Reply