[Cialug] an easier way?

David Champion dchamp1337 at gmail.com
Fri Apr 24 21:33:19 UTC 2020


Were you able to try Barry's suggestion (with caveats)?

He said:

UPDATE table SET column= SUBSTR(column, 0, LOCATE(column, '<script')) WHERE
column LIKE '%<script'

You could test to see what this will do with this query (I think this is
right, haven't done a lot of mysql lately) :

SELECT SUBSTR(column, 0, LOCATE(column, '<script')) AS mytest WHERE column
LIKE '%<script'

This should show you just the substring that would be replaced in all of
the records that match.

-dc


On Fri, Apr 24, 2020 at 1:34 PM L. V. Lammert <lvl at omnitec.net> wrote:

> On Fri, 24 Apr 2020 chris at bynw.com wrote:
>
> > I've tried that in a number of different text editors and they all give
> me the same result. Pattern not found.
> >
> sed would work a lot better if you can get the regex figured out, ..
>
>         Lee
> _______________________________________________
> Cialug mailing list
> Cialug at cialug.org
> https://www.cialug.org/cgi-bin/mailman/listinfo/cialug
>


More information about the Cialug mailing list