Quote from: Chen Zhen on February 17, 2026, 06:14:46 PMAssuming this is just for altering what's within your custom BBCode tags for: messages -> body
You can use custom server side code to manipulate MySQL data (ie. PHP) or you can use regexp on a MySQL command line.
MySQL command line (assuming the prefix is "smf_") :UPDATE `smf_messages` SET `body` = CONCAT(
SUBSTRING_INDEX(body, '[embed]', 1),
'[/embed]',
CAST(REGEXP_SUBSTR(body, '(?<=[embed])[0-9]+') AS UNSIGNED) - 500,
'[/embed]',
SUBSTRING_INDEX(body, '[embed]', -1)
)
WHERE body REGEXP '[embed][0-9]+[/embed]';
I have no idea if the above will work but it might give you something to test on a copy of the database to make sure it works as intended. If you can't figure it out with the above then I can delve into it further by running some tests on a localhost.
If you're using PHPMyAdmin, keep in mind that it's written in PHP & will time out for long queries unless you increase some PHP limits. Another option is to use MySQL via Bash which should avoid any script timeouts.
UPDATE `smf_messages` SET `body` = CONCAT(
SUBSTRING_INDEX(body, '[embed]', 1),
'[/embed]',
CAST(REGEXP_SUBSTR(body, '(?<=[embed])[0-9]+') AS UNSIGNED) - 500,
'[/embed]',
SUBSTRING_INDEX(body, '[embed]', -1)
)
WHERE body REGEXP '[embed][0-9]+[/embed]';Quote from: Dave on February 14, 2026, 02:31:37 AMThought it was just me at first.
Just tried with the post you deleted and now it's working OK