What is stored in the database is the html code, how to blur the contents of the query tag?

what is stored in the database is the html code, which is mainly a piece of div content, including the style, does not contain the body and other tags, and the label is strict in opening and closing. If I want to query the keyword "class" now, if I use like "% class%", I will definitely find out that the tag contains "class", but I only want the content of the page to contain "class". What can I do?

A rookie, a lot of advice.

Mar.03,2021

provide an idea. With regular expression , you can try the following code:

SELECT
    *
FROM
    CLASS_TEST
WHERE
    CONTENT REGEXP  '>[^<]*class[^>]*<'
;

specifically means that the content of CONTENT needs to contain a > and < with class, and no other tags.
you can take a look at the . It's a little foggy at first, but you'll be fine after you become proficient.

I hope I can help you.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf61d9-31fda.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf61d9-31fda.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?