Resource icon

Post Content Find / Replace 1.0.0

No permission to download
The differences mean nothing, they are options I added to my own....the point is I tested the expression not only with a regex tester but by injecting the erroneous strings into my DB and then trying the post replacement on them the exact way I have shown you and it works so I have to guess it is something wrong on your server end...maybe your php is using a broken alternative PCRE library, either way the error is completely on your end and there is nothing I can do about it. Speak to the guy who manages your server.
 
My regex-fu isn't strong enough for this. How would I replace the following with the appropriate media BB code?

[youtube=vrCb_fNmSTA]The YouTube video's title[/youtube]

Also, after converting from vBulletin to XenForo some of the posts where people used alternate font colors and sizes have lines like this:

[FONT=Arial, Helvetica, sans-serif]So in future, be more careful!"[/FONT]

Can this add-on clean it up somehow?
 
[youtube=vrCb_fNmSTA]The YouTube video's title[/youtube]

Quick Find:
Code:
youtube

Regular expression:
Code:
#\[(youtube)=([a-z0-9-_]{11})](?:.*?(?!\[/\1]?)).(?:\[/\1])#siu

Replacement String:
Code:
[media=\1]\2[/media]



Also, after converting from vBulletin to XenForo some of the posts where people used alternate font colors and sizes have lines like this:

[FONT=Arial, Helvetica, sans-serif]So in future, be more careful!"[/FONT]

Can this add-on clean it up somehow?
Yes it can but clean up can mean different things depending on what exactly it is that you want to do with them.
 
Please any one can let me know, How to remove BB code tag from post ? not Replace.
To remove or to replace is generally the same thing when you actually apply the changes...to remove you are simply replacing something that exists, with nothing or blank space basically.

read: leave the replacement field blank
 
OMG, you converted your site to XF?

Yes, but does not know any knowledge about XF

To remove or to replace is generally the same thing when you actually apply the changes...to remove you are simply replacing something that exists, with nothing or blank space basically.

read: leave the replacement field blank

Not working for me, Is my BBcode tag [FONT=&amp] but after the run Post Content Replacement Tool then now its saved to []

Not removed full code [FONT=&amp]

ScreenShot00052.webp
 
[FONT=&amp] is not how to write a regular expression.

[ must be escaped and all regular expressions must start and end with a delimiter ( your [ and ] are being used as delimiters therefor they are not part of what is matched by the expression).

Did you save the changes or run the tool the first time with the box unchecked?

#\[FONT=&amp]#siu​
is how that regular expression should look.

- - - - - -
To remove all instances of []

quickfind: []
regular expression: #\[]#siu​
 
One more thing, how to remove from thread ID or post ID ? I have removed [FONT=&amp] 8700 post but now need to remove [/FONT], If i remove [/FONT] that will do remove 37500 post. Its will remove all [/FONT] where the code are still working.
 
You should not remove the opening tag before the closing tag in this case (the opening tag is the unique identifier in this case).

You need the opening [FONT=FONT-NAME] and the closing [/font] so that you can replace them all at once or alternatively remove the closing [/font] first leaving you with something you can safely target (the opening tag).

If fixing that is important to you, you pretty much have two choices at this point.
  1. You can reload the most recent backup of your board and start again observing a strategic order of operations.

    or

  2. You would need an expression that matched every [/font] that was not led by an instance of a variation of [FONT=Font-name] and was not part of a set of open and close tags and then replace that.

    The best way to do this is to test your expressions on a trial run of the import, work out your replacements and write them down, then do the actual live import and when that is complete run your list of replacements you took note of.

    If this is on your live board you might considering seeking assistance as this process is not usually something a person new to it will pick up quickly.
 
OK, I will now going to do with replace with (xenforo font name)

To remove all instances of [FONT=&amp]

quickfind: [FONT=&amp]
regular expression: #\[FONT=&amp]#siu
replace: [FONT=&arial]

Does this correct?
 
I need help to replace but does not know how to doing this ? Please any one can help me ?

showthread.php?619-অস্মিতের-সাথে-নীর্জনে-আড্ডা replace to index.php?threads/অস্মিতের-সাথে-নীর্জনে-আড্ডা.199
 
Very useful tool, and thanks for the modification @EQnoble

What would be useful though is the ability to save and run the save job as a scheduled cron job..

Would be particularity useful for removing Tapatalk signatures, without admin intervention
 
screen.webp Hi, seems to be a great tool if some know how to use it :D

What I would like to know is... I have lots and lots of links which are starting with http://www.invalid1c is there anyway so remove the entire line where it startes with this or at least "unlink" them so they don't appear as links any longer in any message/post ?

I think the above will delete only the "http://www.invalid1c" but I want it to delete the entire line means everything that comes after "http://www.invalid1c" /something/something/index.php"
 
Last edited:
View attachment 135048 Hi, seems to be a great tool if some know how to use it :D

What I would like to know is... I have lots and lots of links which are starting with http://www.invalid1c is there anyway so remove the entire line where it startes with this or at least "unlink" them so they don't appear as links any longer in any message/post ?

I think the above will delete only the "http://www.invalid1c" but I want it to delete the entire line means everything that comes after "http://www.invalid1c" /something/something/index.php"
try to add ".+" to the regular expression


Hello, Try this one:

Quick Find:
Code:
[IMG]http://www.example.com/forum/attachment.php?attachmentid

Regex:
Code:
#(\[img]http://www\.example\.com)/forum/attachment\.php\?attachmentid=([0-9]+)&d=([0-9]+)(\[/img])#siu

Replace:
Code:
\1/xendev/attachments/\2/\4

Always try first without saving.

I have a problem with this Addon

I'm trying this but with URL instead of IMG but when I run a text it didn't return anything, it load and then it simply reload the page without any result or message

this is what I'm trying:

Quick Find:
Code:
[URL]http://sub.domain.com/forum/attachment.php?attachmentid

Regex:
Code:
#\[URL]http://sub\.domain\.com/forum/attachment\.php\?attachmentid=([0-9]+)&d=[0-9]+\[/URL]#siu

Replace:
Code:
[ATTACH]\1[/ATTACH]

What it's wrong with it?

EDIT:
My bad!!! the old vbulletin forum wasn't in the /forum/ directory! ;)
 
Last edited:
is the Quick Find unable to find string with single quote?

Example:
I have many links like that:

[url='http://imageshack.us'][/url]

I want to filter them and then replace the URL with another one.
 
Back
Top Bottom