Jump to content

Recommended Posts

Does anyone know of an program that will allow me to search for terms within a specific part of PHP source code? Like in comments, strings, variable names, etc?

 

I am needing to rebrand an program, but since the old name is everywhere (500+ files), I am just wanting to search for the old name in strings and outside of the <?php and ?> tags.

 

Is this someting that I could do with grep/regular expressions? Or is it too hard to make a regular expression that can handle PHP code?

Link to comment
https://forums.phpfreaks.com/topic/103282-php-source-code-search/
Share on other sites

Yes, I know how to use grep or equivalent file content searching programs, like KFileReplace.  I was wondering if there was a regular expression or program that would allow you to search in specific parts of PHP source code like comments, strings, identifiers.

 

I did find a way to do the rebranding. With a couple of different searches, I was able to find ( hopefully ) all references to that name, but I had to manually sort through hundreds of hits in comments and variable/constant identifiers and that is what I was hoping to avoid.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.