News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
Sean Coates' Blog:
PHP Pie?
February 19, 2007 @ 08:20:00

Sean Coates has created a simple version of a popular bit of Perl functionality and shares the code in hi slatest post - the "pie" ability to perform a search and replace, line by line, through a file using a regular expression.

I've often found myself looking for a PHP equivalent. Not to do simple substitutions, of course, but complex ones. And since I'm most comfortable with PHP, and a I have a huge library of snippets that I can dig out to quell a problem that I may have solved years ago, I've been meaning to fill this void for a while.

So, one evening, he came home and hashed out this version of the script. He includes the code in the post...it works on the command line and pulls in a file (though STDIN) and loops through the buffered version to perform the regex replace.

0 comments voice your opinion now!
perl pie parse regularexpression code example replace search perl pie parse regularexpression code example replace search



Similar Posts

Brian DeShong's Blog: Development process for PHP-based projects

Nick Halstead's Blog: Simple use of DIGG API for your blog

Zend Developer Zone: Creating Template-Based Applications with HTML_Template_Flexy

KillerPHP Blog: PHP Interfaces: when and why you should use them instead of classes?

Paul Jones' Blog: TDD, Test-First, and Ravioli Code


Community Events







Don't see your event here?
Let us know!


job security ajax package PEAR book cakephp conference releases zendframework code framework mysql zend database PHP5 application developer release example

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework