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\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\"\\\\\\\\"\\\\"\\"\">
<thead>
<tr>
<td>
<p> </p>
</td>
</tr>
</thead>
...
Problem
The problem here is that there was a series of copy/paste actions by the user, where Ckeditor eventually applied the escape character \
to the escape character \
and so forth giving rise to what can be seen above.
With each new copy the number of bars was increasing...
Given the number of \
be different in each place and in each record in the table, and given the amount of records, manual resolution of this subject is impracticable.
Question
How to apply a regular expression to a database update query by updating the field description
with the value it contains, but cleaning all those escape bars, leaving only one where more than one is found?
Theoretical example:
UPDATE product
SET description = (description - milhões de barras)
WHERE 1
Not relevant, but the question of copying and pasting by cleaning previously applied escape characters is already solved on the PHP side. New records won’t cause this problem again. The issue seeks a Mysql solution to deal with old records already present in the database.