News Feed
Sections




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

Jonnay's Blog:
Introducing BunnyRegex - easy regular expressions, and mini-languages inside of PHP.
March 02, 2006 @ 06:52:20

On his blog today, Jonnay has posted information about a new library he's built up called "BunnyRegex", a way to make easy regular expressions and mini-languages inside of PHP.

Regular expressions are hard. They are hard to create, and even harder to read after the fact. Regular expressions, while quite powerful, are a blight upon readable code. There is no easy way to know that '/^d{4}/d{2}/d{2}$/' is a search for a string in the form of 'xxxx/xx/xx'. You have to know that ^ is the start of a line, d is a digit, / is / escaped, etc.

Granted, once you know regular expressions, that information is portable across which ever language you use, be it PHP, Perl, Javascript, whatever. But getting to that point is not easy, and even after you are there, the fact remains:Regular expressions are not human parseable. This is where BunnyRegex comes in.

He includes examples of the usage of the library (not as concise as a regex, but easier to read) and how you can also use it to create "fluent regular expressions". The library even allows you to do most of the normal things you would with a standard regex engine - match, grep, replace, and splitting data.

2 comments voice your opinion now!
regular expression bunnyregex simple fluent human-parseable regular expression bunnyregex simple fluent human-parseable


blog comments powered by Disqus

Similar Posts

DevShed: Sending Email with PHP Networking

Zoomzum Blog: 10 Powerful PHP Regular Expression For Developers

Eirik Hoem's Blog: Handy online regex tool for PHP, Perl, JS and Python

PHPit.net: Creating a chat script with PHP and Ajax, Part 1

Ryan Malesevich's Blog: WP Plugins: Database Backup


Community Events





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


introduction list release configure code library application interview bugfix community series laravel api language install podcast wordpress threedevsandamaybe developer unittest

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