Post replace

MrC

Active member
I am using Post Replace addon by Kier to replace a string, say "xyz", with a space. Should I put " " (space - without the quotation marks) in the Replacement String box? If not, do I need to put some special character, which represents the space character, in the box? And what should the special character be?

Thanks.
 
For simple replacements you can use a direct query on the database:

Code:
UPDATE xf_post
SET message = REPLACE(message, 'xyz', ' ');

You don't need Kier's addon for this simple replacement.
 
Sorry :). My example was over simplified. To be precise, I am trying to remove the tag lines created by the Double Post addon and replace each tag line by a space. The tag lines have the following format:

Code:
[DOUBLEPOST=1352988138][/DOUBLEPOST] (where the number is the posted date)

So I used:

Code:
Quick Find: [DOUBLEPOST
 
Regular Expression: #\[DOUBLEPOST=\d+\]\[/DOUBLEPOST\]#siU
 
Replacement String: " " (without the quotation marks)

I tested the above, it seemed to find all the tag lines created by Double Post, but the Replacement String boxes were empty (no space characters). So I am guessing I did not do it correctly.
 
It's correct. I tested it.

A space character replacement will show as "empty". It only shows the replacement for the actual matched text, not the entire post.
 
  • Like
Reactions: MrC
It's correct. I tested it.

A space character replacement will show as "empty". It only shows the replacement for the actual matched text, not the entire post.
I created a simple text for testing: "helloxyzkJake Bunce". And I did the following with Post Replace

Code:
Quick Find: xyzk
 
Regular Expression: #xyzk#
Replacement String: " " (without the quotation marks)
The text, after the replacement, became "helloJake Bunce". But it should be "hello Jake Bunce".
 
Top Bottom