There is a table with 1000 or more entries. In many of these entries in the text at the end of what that sage left <br> .
Colleagues, I have a code that changes the last entry that I submit to the procedure. In this example, I am trying to remove the last <br> . But the catch is this: it changes by exact coincidence, that is, <br/> in the span. How can you arrange so that it replaces all the br tags?
DROP PROCEDURE IF EXISTS replaceBr; DELIMITER | CREATE PROCEDURE replaceBr (IN mytext TEXT, IN br VARCHAR (255)) BEGIN SELECT CONCAT( SUBSTR( mytext, 1, LENGTH(mytext) - LENGTH(SUBSTRING_INDEX(mytext, br, - 1)) - LENGTH(br) ), SUBSTRING_INDEX(mytext, br, - 1 ) ) ; END ; | DELIMITER ; CALL replaceBr ('aaa bbb <br> ccc <br > ddd', '<br>') ; I think you first need to bring mytext to a single standard. That is, replace all matching br to a single <br> . And then my function will work.
In my opinion, the regular form looks like this: "/[\n\r\s]*<br\s*\/?>[\n\r\s]*/" . But how to apply it, how to make it all work?
Thank.
<and>i.e. not part of the tags. for exampleabc <div id="a>x">(a very strained example of course)? - Mikebr, the rest is not interested - user216109