>>>> 2012/10/12 17:56 +0100, Neil Tompkins >>>>
Is there such a way in a MySQL query to extract the text "this is a test"
from the following strings as a example

<strong><a href="http://www.domain.com/"; class="link">this is a
test</a></strong>
<strong><a href="http://www.domain.com/"; title="this is a test"
class="link">link</a></strong> 
<<<<<<<<
Amongst the built-in functions there isn't much; for the former example, if the 
string is "s", this works:
SUBSTRING_INDEX(SUBSTRING_INDEX(s, '>', -3), '<', 1)
; for the latter, if "t":
SUBSTRING_INDEX(SUBSTRING_INDEX(t, '"', -4), '"', 1)
.

If you want a real HTML parser that discards everything but arbitrary strings, 
you have to get & install your own.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to