Class Text Search Replace : New Update

Today I made an update of my class “Text Search Replace” at This update will increase the search capability of the class. The initial release of the class could not search some special characters (well, I just forgot & missed this to put with the initial release). Later a user of this class (his name is “Robert”) noticed the problem and asked me for a solution. I was too busy to touch the class. But I managed time and fixed it. You can now work with special characters(especially the ones are part of regular expression syntax). I am sure this fix has increased the usability of this class to a large extent.

Please download the latest version from here:

Special thanks to Robert who noticed and informed me about the problem.

If you are a user of this class, please send me bugs, etc so I can work to improve its performances.



8 thoughts on “Class Text Search Replace : New Update

  1. Gday,

    First off I just like to say I really like your website as it has been a great help to me. SoI thought I would just alert you to a small bug that I found in this script.

    The bug is to do with the variable caseSentive. On line 65 you have it as caseSensitivity, the script will still run but it does throw up an error. All you have to do is change it to caseSensitive and the error goes away.

    $this->$caseSensitive = 1

    returns and error Undefined variable $caseSensitivity on line 65

    It should be:

    $this->$caseSensitive = 1



  2. Hi Rupom, 2 things. I’m working with windows files. I would like to replace all ‘\r\n’ in the files with ” (nothing, no space or anything). I’m am trying to figure out how to get the class to stop checking to see if the replacementKey is null or empty. I know this is an important test for the class and I don’t need to do it every time. Can you help me get around this with out changing the class entirely?? One last thing, the script changes all files in subdirectories too. If you have backup files in a subdirectory or subfolder, they will get changed by the class. Is there any way to prevent this. Appreciate your time, Luke.


  3. Hi again Rupom, I was able to modify the class to allow for the replacement key to be null. If any of your readers need help I’ll be happy to post the whole code. Thank you so much for developing this class.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.