CodeIgniter Forums
regex for mass removing my log_message(....) lines - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: regex for mass removing my log_message(....) lines (/showthread.php?tid=20854)



regex for mass removing my log_message(....) lines - El Forum - 07-23-2009

[eluser]dmyers[/eluser]
unfortunately, I am not a regex guru. Can somebody help me out and tell me the regex for removing all of my log_message(...) lines?

After I am done debugging stuff they tend to litter my code / classes and I would like to get rid of them with a quick find & replace in a text wrangler selected folder of files.

Thank's


regex for mass removing my log_message(....) lines - El Forum - 07-24-2009

[eluser]TheFuzzy0ne[/eluser]
It can be done, but it could potentially become quite complex. Instead, I'd suggest that you grep for log_message() lines and comment them out manually. Are there really that many?


regex for mass removing my log_message(....) lines - El Forum - 07-24-2009

[eluser]sophistry[/eluser]
off the top of my head...
pattern
Code:
'(^.*log_message.+$)'
replace
Code:
'\/\/\1'

only works if you have no return/linebreaks in your log_message lines.

still, fuzzy's suggestion is the best.