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.

Menu