• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Post Content Find / Replace 1.0.0

No permission to download

Chris D

XenForo developer
Staff member
I've simplified the regex slightly but you might want to do a few searches to see if there's any alternative URLs such as https:// or youtu.be links if so, the regex can probably be adjusted but this should cover the basic case for now and stop it from being so greedy:
Code:
/\[url=http:\/\/(?:www\.)*+youtube\.com\/watch\?v=([\w\-]+)\].+\[\/url\]/siU
 
I've simplified the regex slightly but you might want to do a few searches to see if there's any alternative URLs such as https:// or youtu.be links if so, the regex can probably be adjusted but this should cover the basic case for now and stop it from being so greedy:
Code:
/\[url=http:\/\/(?:www\.)*+youtube\.com\/watch\?v=([\w\-]+)\].+\[\/url\]/siU
Brilliant, that worked perfectly. Thanks!
 
1. How many million posts do you need to trigger timeout on post replace?
2. Is "Quick Find" field value sensitive case?

Update :
8 million posts and i got timeout.
I used this instead :)
Code:
UPDATE xf_post
SET message = REGEXP_REPLACE(message, '(?)replace from', 'replace into');
 
Last edited:
Thanks for the awesome addon, it helped me alot, but maybe you could help me with one last regex:

I'm converting from burning board via mybb and since burning board uses html for quotes, i have some issues.

The current regex works for 95% of the quotes:
Code:
/\<woltlab-quote data-author=\"(.*)\"\s.*\?postID=(\d*).*\">(.*)<\/woltlab-quote>/sim
The problem howerver is that 'date-author' and 'postId?=' are in a switched position in some cases and that breaks those quotes since the regex matches it directly.

Heres is a working example:
https://regex101.com/r/48RvUQ/1

So sometimes date-author is in the place of data-link and that causes a issue. i'd like to have a regex that does the same thing as the one above, but for both cases....