dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/103282-php-source-code-search/ Share on other sites More sharing options...
Daniel0 Posted April 28, 2008 Share Posted April 28, 2008 grep will do it fine. Otherwise, I think Zend Studio 6 allows you to search files recursively for a string. Quote Link to comment https://forums.phpfreaks.com/topic/103282-php-source-code-search/#findComment-529037 Share on other sites More sharing options...
neylitalo Posted April 28, 2008 Share Posted April 28, 2008 sed -i -e "s/search regex/replace string/g" file.php Quote Link to comment https://forums.phpfreaks.com/topic/103282-php-source-code-search/#findComment-529038 Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Author Share Posted April 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/103282-php-source-code-search/#findComment-529046 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.