News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Practicing Regular Expressions with Search and Replace
November 23, 2011 @ 14:27:59

On PHPMaster.com today there's a new tutorial that shares a few regular expression tips about doing some search and replace in your content.

So how can you practice using regex if you are limited to just using them in your code? The answer is to use a utility, of which there are many, that uses regex for performing search and replace. I'm sure everyone is familiar with the standard "find x and replace it with y" type of search and replace. Most IDEs and text editors have built in regex engines to handle search and replace. In this article I'd like to walk through a series of exercises to help you practice using regex.

His examples are based on Netbeans but can be used in just about any IDE that supports regex (or even just your code). He shows how to match word boundaries, do some grouping, work with back references and doing some search/replace based on multiple groupings.

0 comments voice your opinion now!
regular expression practice search replace boundaries group backreference


blog comments powered by Disqus

Similar Posts

Boston PHP User Group: Chris Shiflett Presents on the Zend Framework

PHP Zurich User Group: Meeting March 14th, 2006 @ 18:30

Dallas PHP User\'s Group: PHP5 Exception Handling (presentation)

Mike Purcell's Blog: PHPUnit - How to Run PHPUnit Against a Specific Test

Jonnay\'s Blog: Introducing BunnyRegex - easy regular expressions, and mini-languages inside of PHP.


Community Events

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


api community performance conference symfony2 application opinion example framework part2 voicesoftheelephpant podcast configure library release interview php7 series laravel introduction

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